MindsDB 25.9.1.2__py3-none-any.whl → 25.9.3rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of MindsDB might be problematic. Click here for more details.
- mindsdb/__about__.py +1 -1
- mindsdb/__main__.py +39 -20
- mindsdb/api/a2a/agent.py +7 -9
- mindsdb/api/a2a/common/server/server.py +3 -3
- mindsdb/api/a2a/common/server/task_manager.py +4 -4
- mindsdb/api/a2a/task_manager.py +15 -17
- mindsdb/api/common/middleware.py +9 -11
- mindsdb/api/executor/command_executor.py +2 -4
- mindsdb/api/executor/datahub/datanodes/datanode.py +2 -2
- mindsdb/api/executor/datahub/datanodes/integration_datanode.py +100 -48
- mindsdb/api/executor/datahub/datanodes/project_datanode.py +8 -4
- mindsdb/api/executor/datahub/datanodes/system_tables.py +1 -1
- mindsdb/api/executor/exceptions.py +29 -10
- mindsdb/api/executor/planner/plan_join.py +17 -3
- mindsdb/api/executor/sql_query/sql_query.py +74 -74
- mindsdb/api/executor/sql_query/steps/fetch_dataframe.py +1 -2
- mindsdb/api/executor/sql_query/steps/subselect_step.py +0 -1
- mindsdb/api/executor/utilities/functions.py +6 -6
- mindsdb/api/executor/utilities/sql.py +32 -16
- mindsdb/api/http/gui.py +5 -11
- mindsdb/api/http/initialize.py +8 -10
- mindsdb/api/http/namespaces/agents.py +10 -12
- mindsdb/api/http/namespaces/analysis.py +13 -20
- mindsdb/api/http/namespaces/auth.py +1 -1
- mindsdb/api/http/namespaces/config.py +15 -11
- mindsdb/api/http/namespaces/databases.py +140 -201
- mindsdb/api/http/namespaces/file.py +15 -4
- mindsdb/api/http/namespaces/handlers.py +7 -2
- mindsdb/api/http/namespaces/knowledge_bases.py +8 -7
- mindsdb/api/http/namespaces/models.py +94 -126
- mindsdb/api/http/namespaces/projects.py +13 -22
- mindsdb/api/http/namespaces/sql.py +33 -25
- mindsdb/api/http/namespaces/tab.py +27 -37
- mindsdb/api/http/namespaces/views.py +1 -1
- mindsdb/api/http/start.py +14 -8
- mindsdb/api/mcp/__init__.py +2 -1
- mindsdb/api/mysql/mysql_proxy/executor/mysql_executor.py +15 -20
- mindsdb/api/mysql/mysql_proxy/mysql_proxy.py +26 -50
- mindsdb/api/mysql/mysql_proxy/utilities/__init__.py +0 -1
- mindsdb/api/postgres/postgres_proxy/executor/executor.py +6 -13
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_packets.py +40 -28
- mindsdb/integrations/handlers/byom_handler/byom_handler.py +168 -185
- mindsdb/integrations/handlers/chromadb_handler/chromadb_handler.py +11 -5
- mindsdb/integrations/handlers/file_handler/file_handler.py +7 -0
- mindsdb/integrations/handlers/lightwood_handler/functions.py +45 -79
- mindsdb/integrations/handlers/openai_handler/openai_handler.py +1 -1
- mindsdb/integrations/handlers/pgvector_handler/pgvector_handler.py +20 -2
- mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +18 -3
- mindsdb/integrations/handlers/shopify_handler/shopify_handler.py +25 -12
- mindsdb/integrations/handlers/snowflake_handler/snowflake_handler.py +2 -1
- mindsdb/integrations/handlers/statsforecast_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/statsforecast_handler/requirements_extra.txt +1 -0
- mindsdb/integrations/handlers/web_handler/urlcrawl_helpers.py +4 -4
- mindsdb/integrations/libs/api_handler.py +10 -10
- mindsdb/integrations/libs/base.py +4 -4
- mindsdb/integrations/libs/llm/utils.py +2 -2
- mindsdb/integrations/libs/ml_handler_process/create_engine_process.py +4 -7
- mindsdb/integrations/libs/ml_handler_process/func_call_process.py +2 -7
- mindsdb/integrations/libs/ml_handler_process/learn_process.py +37 -47
- mindsdb/integrations/libs/ml_handler_process/update_engine_process.py +4 -7
- mindsdb/integrations/libs/ml_handler_process/update_process.py +2 -7
- mindsdb/integrations/libs/process_cache.py +132 -140
- mindsdb/integrations/libs/response.py +18 -12
- mindsdb/integrations/libs/vectordatabase_handler.py +26 -0
- mindsdb/integrations/utilities/files/file_reader.py +6 -7
- mindsdb/integrations/utilities/rag/config_loader.py +37 -26
- mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +59 -9
- mindsdb/integrations/utilities/rag/rerankers/reranker_compressor.py +4 -4
- mindsdb/integrations/utilities/rag/retrievers/sql_retriever.py +55 -133
- mindsdb/integrations/utilities/rag/settings.py +58 -133
- mindsdb/integrations/utilities/rag/splitters/file_splitter.py +5 -15
- mindsdb/interfaces/agents/agents_controller.py +2 -1
- mindsdb/interfaces/agents/constants.py +0 -2
- mindsdb/interfaces/agents/litellm_server.py +34 -58
- mindsdb/interfaces/agents/mcp_client_agent.py +10 -10
- mindsdb/interfaces/agents/mindsdb_database_agent.py +5 -5
- mindsdb/interfaces/agents/run_mcp_agent.py +12 -21
- mindsdb/interfaces/chatbot/chatbot_task.py +20 -23
- mindsdb/interfaces/chatbot/polling.py +30 -18
- mindsdb/interfaces/data_catalog/data_catalog_loader.py +10 -10
- mindsdb/interfaces/database/integrations.py +19 -2
- mindsdb/interfaces/file/file_controller.py +6 -6
- mindsdb/interfaces/functions/controller.py +1 -1
- mindsdb/interfaces/functions/to_markdown.py +2 -2
- mindsdb/interfaces/jobs/jobs_controller.py +5 -5
- mindsdb/interfaces/jobs/scheduler.py +3 -8
- mindsdb/interfaces/knowledge_base/controller.py +54 -25
- mindsdb/interfaces/knowledge_base/preprocessing/json_chunker.py +40 -61
- mindsdb/interfaces/model/model_controller.py +170 -166
- mindsdb/interfaces/query_context/context_controller.py +14 -2
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +6 -4
- mindsdb/interfaces/skills/retrieval_tool.py +43 -50
- mindsdb/interfaces/skills/skill_tool.py +2 -2
- mindsdb/interfaces/skills/sql_agent.py +25 -19
- mindsdb/interfaces/storage/fs.py +114 -169
- mindsdb/interfaces/storage/json.py +19 -18
- mindsdb/interfaces/storage/model_fs.py +54 -92
- mindsdb/interfaces/tabs/tabs_controller.py +49 -72
- mindsdb/interfaces/tasks/task_monitor.py +3 -9
- mindsdb/interfaces/tasks/task_thread.py +7 -9
- mindsdb/interfaces/triggers/trigger_task.py +7 -13
- mindsdb/interfaces/triggers/triggers_controller.py +47 -50
- mindsdb/migrations/migrate.py +16 -16
- mindsdb/utilities/api_status.py +58 -0
- mindsdb/utilities/config.py +49 -0
- mindsdb/utilities/exception.py +40 -1
- mindsdb/utilities/fs.py +0 -1
- mindsdb/utilities/hooks/profiling.py +17 -14
- mindsdb/utilities/langfuse.py +40 -45
- mindsdb/utilities/log.py +272 -0
- mindsdb/utilities/ml_task_queue/consumer.py +52 -58
- mindsdb/utilities/ml_task_queue/producer.py +26 -30
- mindsdb/utilities/render/sqlalchemy_render.py +8 -7
- mindsdb/utilities/utils.py +2 -2
- {mindsdb-25.9.1.2.dist-info → mindsdb-25.9.3rc1.dist-info}/METADATA +266 -261
- {mindsdb-25.9.1.2.dist-info → mindsdb-25.9.3rc1.dist-info}/RECORD +119 -119
- mindsdb/api/mysql/mysql_proxy/utilities/exceptions.py +0 -14
- {mindsdb-25.9.1.2.dist-info → mindsdb-25.9.3rc1.dist-info}/WHEEL +0 -0
- {mindsdb-25.9.1.2.dist-info → mindsdb-25.9.3rc1.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.9.1.2.dist-info → mindsdb-25.9.3rc1.dist-info}/top_level.txt +0 -0
|
@@ -8,11 +8,7 @@ from mindsdb.utilities.config import Config
|
|
|
8
8
|
from mindsdb.utilities.ml_task_queue.utils import RedisKey, to_bytes
|
|
9
9
|
from mindsdb.utilities.ml_task_queue.task import Task
|
|
10
10
|
from mindsdb.utilities.ml_task_queue.base import BaseRedisQueue
|
|
11
|
-
from mindsdb.utilities.ml_task_queue.const import
|
|
12
|
-
TASKS_STREAM_NAME,
|
|
13
|
-
ML_TASK_TYPE,
|
|
14
|
-
ML_TASK_STATUS
|
|
15
|
-
)
|
|
11
|
+
from mindsdb.utilities.ml_task_queue.const import TASKS_STREAM_NAME, ML_TASK_TYPE, ML_TASK_STATUS
|
|
16
12
|
from mindsdb.utilities import log
|
|
17
13
|
from mindsdb.utilities.sentry import sentry_sdk # noqa: F401
|
|
18
14
|
|
|
@@ -20,25 +16,25 @@ logger = log.getLogger(__name__)
|
|
|
20
16
|
|
|
21
17
|
|
|
22
18
|
class MLTaskProducer(BaseRedisQueue):
|
|
23
|
-
"""
|
|
19
|
+
"""Interface around the redis for putting tasks to the queue
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
Attributes:
|
|
22
|
+
db (Redis): database object
|
|
23
|
+
stream
|
|
24
|
+
cache
|
|
25
|
+
pubsub
|
|
30
26
|
"""
|
|
31
27
|
|
|
32
28
|
def __init__(self) -> None:
|
|
33
|
-
config = Config().get(
|
|
29
|
+
config = Config().get("ml_task_queue", {})
|
|
34
30
|
|
|
35
31
|
self.db = Database(
|
|
36
|
-
host=config.get(
|
|
37
|
-
port=config.get(
|
|
38
|
-
db=config.get(
|
|
39
|
-
username=config.get(
|
|
40
|
-
password=config.get(
|
|
41
|
-
protocol=3
|
|
32
|
+
host=config.get("host", "localhost"),
|
|
33
|
+
port=config.get("port", 6379),
|
|
34
|
+
db=config.get("db", 0),
|
|
35
|
+
username=config.get("username"),
|
|
36
|
+
password=config.get("password"),
|
|
37
|
+
protocol=3,
|
|
42
38
|
)
|
|
43
39
|
self.wait_redis_ping(60)
|
|
44
40
|
|
|
@@ -47,26 +43,26 @@ class MLTaskProducer(BaseRedisQueue):
|
|
|
47
43
|
self.pubsub = self.db.pubsub()
|
|
48
44
|
|
|
49
45
|
def apply_async(self, task_type: ML_TASK_TYPE, model_id: int, payload: dict, dataframe: DataFrame = None) -> Task:
|
|
50
|
-
|
|
46
|
+
"""Add tasks to the queue
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
Args:
|
|
49
|
+
task_type (ML_TASK_TYPE): type of the task
|
|
50
|
+
model_id (int): model identifier
|
|
51
|
+
payload (dict): lightweight model data that will be added to stream message
|
|
52
|
+
dataframe (DataFrame): dataframe will be transfered via regular redis storage
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
Returns:
|
|
55
|
+
Task: object representing the task
|
|
56
|
+
"""
|
|
61
57
|
try:
|
|
62
58
|
payload = pickle.dumps(payload, protocol=5)
|
|
63
59
|
redis_key = RedisKey.new()
|
|
64
60
|
message = {
|
|
65
61
|
"task_type": task_type.value,
|
|
66
|
-
"company_id":
|
|
62
|
+
"company_id": "" if ctx.company_id is None else ctx.company_id, # None can not be dumped
|
|
67
63
|
"model_id": model_id,
|
|
68
64
|
"payload": payload,
|
|
69
|
-
"redis_key": redis_key.base
|
|
65
|
+
"redis_key": redis_key.base,
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
self.wait_redis_ping()
|
|
@@ -77,5 +73,5 @@ class MLTaskProducer(BaseRedisQueue):
|
|
|
77
73
|
self.stream.add(message)
|
|
78
74
|
return Task(self.db, redis_key)
|
|
79
75
|
except ConnectionError:
|
|
80
|
-
logger.
|
|
76
|
+
logger.exception("Cant send message to redis: connect failed")
|
|
81
77
|
raise
|
|
@@ -47,7 +47,7 @@ def _compile_interval(element, compiler, **kw):
|
|
|
47
47
|
if items[1].upper().endswith("S"):
|
|
48
48
|
items[1] = items[1][:-1]
|
|
49
49
|
|
|
50
|
-
if compiler.dialect
|
|
50
|
+
if getattr(compiler.dialect, "driver", None) == "snowflake" or compiler.dialect.name == "postgresql":
|
|
51
51
|
# quote all
|
|
52
52
|
args = " ".join(map(str, items))
|
|
53
53
|
args = f"'{args}'"
|
|
@@ -383,7 +383,7 @@ class SqlalchemyRender:
|
|
|
383
383
|
elif isinstance(t, ast.Parameter):
|
|
384
384
|
col = sa.column(t.value, is_literal=True)
|
|
385
385
|
if t.alias:
|
|
386
|
-
raise RenderError()
|
|
386
|
+
raise RenderError("Parameter aliases are not supported in the renderer")
|
|
387
387
|
elif isinstance(t, ast.Tuple):
|
|
388
388
|
col = [self.to_expression(i) for i in t.items]
|
|
389
389
|
elif isinstance(t, ast.Variable):
|
|
@@ -574,17 +574,18 @@ class SqlalchemyRender:
|
|
|
574
574
|
else:
|
|
575
575
|
condition = self.to_expression(item["condition"])
|
|
576
576
|
|
|
577
|
-
if "ASOF" in join_type:
|
|
577
|
+
if "ASOF" in join_type or "RIGHT" in join_type:
|
|
578
578
|
raise NotImplementedError(f"Unsupported join type: {join_type}")
|
|
579
|
-
|
|
579
|
+
|
|
580
580
|
is_full = False
|
|
581
|
-
|
|
582
|
-
|
|
581
|
+
is_outer = False
|
|
582
|
+
if join_type in ("LEFT JOIN", "LEFT OUTER JOIN"):
|
|
583
|
+
is_outer = True
|
|
583
584
|
if join_type == "FULL JOIN":
|
|
584
585
|
is_full = True
|
|
585
586
|
|
|
586
587
|
# perform join
|
|
587
|
-
query =
|
|
588
|
+
query = query.join(table, condition, isouter=is_outer, full=is_full)
|
|
588
589
|
elif isinstance(from_table, (ast.Union, ast.Intersect, ast.Except)):
|
|
589
590
|
alias = None
|
|
590
591
|
if from_table.alias:
|
mindsdb/utilities/utils.py
CHANGED
|
@@ -22,13 +22,13 @@ def parse_csv_attributes(csv_attributes: typing.Optional[str] = "") -> typing.Di
|
|
|
22
22
|
for row in reader:
|
|
23
23
|
for pair in row:
|
|
24
24
|
# Match key=value pattern
|
|
25
|
-
match = re.match(r
|
|
25
|
+
match = re.match(r"^\s*([^=]+?)\s*=\s*(.+?)\s*$", pair)
|
|
26
26
|
if match:
|
|
27
27
|
key, value = match.groups()
|
|
28
28
|
attributes[key.strip()] = value.strip()
|
|
29
29
|
else:
|
|
30
30
|
raise ValueError(f"Invalid attribute format: {pair}")
|
|
31
31
|
except Exception as e:
|
|
32
|
-
raise ValueError(f"Failed to parse csv_attributes='{csv_attributes}': {e}")
|
|
32
|
+
raise ValueError(f"Failed to parse csv_attributes='{csv_attributes}': {e}") from e
|
|
33
33
|
|
|
34
34
|
return attributes
|