MindsDB 25.9.2.0a1__py3-none-any.whl → 25.10.0__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 +40 -29
- mindsdb/api/a2a/__init__.py +1 -1
- mindsdb/api/a2a/agent.py +16 -10
- mindsdb/api/a2a/common/server/server.py +7 -3
- mindsdb/api/a2a/common/server/task_manager.py +12 -5
- mindsdb/api/a2a/common/types.py +66 -0
- mindsdb/api/a2a/task_manager.py +65 -17
- mindsdb/api/common/middleware.py +10 -12
- mindsdb/api/executor/command_executor.py +51 -40
- mindsdb/api/executor/datahub/datanodes/datanode.py +2 -2
- mindsdb/api/executor/datahub/datanodes/information_schema_datanode.py +7 -13
- mindsdb/api/executor/datahub/datanodes/integration_datanode.py +101 -49
- mindsdb/api/executor/datahub/datanodes/project_datanode.py +8 -4
- mindsdb/api/executor/datahub/datanodes/system_tables.py +3 -2
- mindsdb/api/executor/exceptions.py +29 -10
- mindsdb/api/executor/planner/plan_join.py +17 -3
- mindsdb/api/executor/planner/query_prepare.py +2 -20
- 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 +37 -20
- mindsdb/api/http/gui.py +5 -11
- mindsdb/api/http/initialize.py +75 -61
- mindsdb/api/http/namespaces/agents.py +10 -15
- mindsdb/api/http/namespaces/analysis.py +13 -20
- mindsdb/api/http/namespaces/auth.py +1 -1
- mindsdb/api/http/namespaces/chatbots.py +0 -5
- mindsdb/api/http/namespaces/config.py +15 -11
- mindsdb/api/http/namespaces/databases.py +140 -201
- mindsdb/api/http/namespaces/file.py +17 -4
- mindsdb/api/http/namespaces/handlers.py +17 -7
- mindsdb/api/http/namespaces/knowledge_bases.py +28 -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 +16 -10
- 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/mysql/mysql_proxy/utilities/dump.py +8 -2
- mindsdb/integrations/handlers/byom_handler/byom_handler.py +165 -190
- mindsdb/integrations/handlers/databricks_handler/databricks_handler.py +98 -46
- mindsdb/integrations/handlers/druid_handler/druid_handler.py +32 -40
- mindsdb/integrations/handlers/file_handler/file_handler.py +7 -0
- mindsdb/integrations/handlers/gitlab_handler/gitlab_handler.py +5 -2
- mindsdb/integrations/handlers/lightwood_handler/functions.py +45 -79
- mindsdb/integrations/handlers/mssql_handler/mssql_handler.py +438 -100
- mindsdb/integrations/handlers/mssql_handler/requirements_odbc.txt +3 -0
- mindsdb/integrations/handlers/mysql_handler/mysql_handler.py +235 -3
- mindsdb/integrations/handlers/oracle_handler/__init__.py +2 -0
- mindsdb/integrations/handlers/oracle_handler/connection_args.py +7 -1
- mindsdb/integrations/handlers/oracle_handler/oracle_handler.py +321 -16
- mindsdb/integrations/handlers/oracle_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +14 -2
- mindsdb/integrations/handlers/shopify_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/shopify_handler/shopify_handler.py +80 -13
- 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/handlers/zendesk_handler/zendesk_tables.py +144 -111
- 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/handlers/auth_utilities/snowflake/__init__.py +1 -0
- mindsdb/integrations/utilities/handlers/auth_utilities/snowflake/snowflake_jwt_gen.py +151 -0
- mindsdb/integrations/utilities/rag/config_loader.py +37 -26
- mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +83 -30
- 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 -3
- 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 +16 -17
- mindsdb/interfaces/data_catalog/data_catalog_reader.py +15 -4
- mindsdb/interfaces/database/data_handlers_cache.py +190 -0
- mindsdb/interfaces/database/database.py +3 -3
- mindsdb/interfaces/database/integrations.py +7 -110
- mindsdb/interfaces/database/projects.py +2 -6
- mindsdb/interfaces/database/views.py +1 -4
- 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 -9
- mindsdb/interfaces/jobs/scheduler.py +3 -9
- mindsdb/interfaces/knowledge_base/controller.py +244 -128
- mindsdb/interfaces/knowledge_base/evaluate.py +36 -41
- mindsdb/interfaces/knowledge_base/executor.py +11 -0
- mindsdb/interfaces/knowledge_base/llm_client.py +51 -17
- mindsdb/interfaces/knowledge_base/preprocessing/json_chunker.py +40 -61
- mindsdb/interfaces/model/model_controller.py +172 -168
- mindsdb/interfaces/query_context/context_controller.py +14 -2
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +10 -14
- mindsdb/interfaces/skills/retrieval_tool.py +43 -50
- mindsdb/interfaces/skills/skill_tool.py +2 -2
- mindsdb/interfaces/skills/skills_controller.py +1 -4
- mindsdb/interfaces/skills/sql_agent.py +25 -19
- mindsdb/interfaces/storage/db.py +16 -6
- mindsdb/interfaces/storage/fs.py +114 -169
- mindsdb/interfaces/storage/json.py +19 -18
- 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 -52
- mindsdb/migrations/migrate.py +16 -16
- mindsdb/utilities/api_status.py +58 -0
- mindsdb/utilities/config.py +68 -2
- mindsdb/utilities/exception.py +40 -1
- mindsdb/utilities/fs.py +0 -1
- mindsdb/utilities/hooks/profiling.py +17 -14
- mindsdb/utilities/json_encoder.py +24 -10
- 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 +22 -20
- mindsdb/utilities/starters.py +0 -10
- mindsdb/utilities/utils.py +2 -2
- {mindsdb-25.9.2.0a1.dist-info → mindsdb-25.10.0.dist-info}/METADATA +286 -267
- {mindsdb-25.9.2.0a1.dist-info → mindsdb-25.10.0.dist-info}/RECORD +145 -159
- mindsdb/api/mysql/mysql_proxy/utilities/exceptions.py +0 -14
- mindsdb/api/postgres/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/executor/__init__.py +0 -1
- mindsdb/api/postgres/postgres_proxy/executor/executor.py +0 -189
- mindsdb/api/postgres/postgres_proxy/postgres_packets/__init__.py +0 -0
- mindsdb/api/postgres/postgres_proxy/postgres_packets/errors.py +0 -322
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_fields.py +0 -34
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message.py +0 -31
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_formats.py +0 -1265
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_identifiers.py +0 -31
- mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_packets.py +0 -253
- mindsdb/api/postgres/postgres_proxy/postgres_proxy.py +0 -477
- mindsdb/api/postgres/postgres_proxy/utilities/__init__.py +0 -10
- mindsdb/api/postgres/start.py +0 -11
- mindsdb/integrations/handlers/mssql_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/mssql_handler/tests/test_mssql_handler.py +0 -169
- mindsdb/integrations/handlers/oracle_handler/tests/__init__.py +0 -0
- mindsdb/integrations/handlers/oracle_handler/tests/test_oracle_handler.py +0 -32
- {mindsdb-25.9.2.0a1.dist-info → mindsdb-25.10.0.dist-info}/WHEEL +0 -0
- {mindsdb-25.9.2.0a1.dist-info → mindsdb-25.10.0.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.9.2.0a1.dist-info → mindsdb-25.10.0.dist-info}/top_level.txt +0 -0
|
@@ -10,6 +10,7 @@ from sqlalchemy.dialects import mysql, postgresql, sqlite, mssql, oracle
|
|
|
10
10
|
from sqlalchemy.schema import CreateTable, DropTable
|
|
11
11
|
from sqlalchemy.sql import ColumnElement
|
|
12
12
|
from sqlalchemy.sql import functions as sa_fnc
|
|
13
|
+
from sqlalchemy.engine.interfaces import Dialect
|
|
13
14
|
|
|
14
15
|
from mindsdb_sql_parser import ast
|
|
15
16
|
|
|
@@ -80,27 +81,27 @@ def get_is_quoted(identifier: ast.Identifier):
|
|
|
80
81
|
return quoted
|
|
81
82
|
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"Snowflake": oracle,
|
|
93
|
-
}
|
|
84
|
+
dialects = {
|
|
85
|
+
"mysql": mysql,
|
|
86
|
+
"postgresql": postgresql,
|
|
87
|
+
"postgres": postgresql,
|
|
88
|
+
"sqlite": sqlite,
|
|
89
|
+
"mssql": mssql,
|
|
90
|
+
"oracle": oracle,
|
|
91
|
+
}
|
|
92
|
+
|
|
94
93
|
|
|
94
|
+
class SqlalchemyRender:
|
|
95
|
+
def __init__(self, dialect_name: str | Dialect):
|
|
95
96
|
if isinstance(dialect_name, str):
|
|
96
97
|
dialect = dialects[dialect_name].dialect
|
|
97
98
|
else:
|
|
98
99
|
dialect = dialect_name
|
|
99
100
|
|
|
100
101
|
# override dialect's preparer
|
|
101
|
-
if hasattr(dialect, "preparer"):
|
|
102
|
+
if hasattr(dialect, "preparer") and dialect.preparer.__name__ != "MDBPreparer":
|
|
102
103
|
|
|
103
|
-
class
|
|
104
|
+
class MDBPreparer(dialect.preparer):
|
|
104
105
|
def _requires_quotes(self, value: str) -> bool:
|
|
105
106
|
# check force-quote flag
|
|
106
107
|
if isinstance(value, AttributedStr):
|
|
@@ -116,7 +117,7 @@ class SqlalchemyRender:
|
|
|
116
117
|
# or (lc_value != value)
|
|
117
118
|
)
|
|
118
119
|
|
|
119
|
-
dialect.preparer =
|
|
120
|
+
dialect.preparer = MDBPreparer
|
|
120
121
|
|
|
121
122
|
# remove double percent signs
|
|
122
123
|
# https://docs.sqlalchemy.org/en/14/faq/sqlexpressions.html#why-are-percent-signs-being-doubled-up-when-stringifying-sql-statements
|
|
@@ -383,7 +384,7 @@ class SqlalchemyRender:
|
|
|
383
384
|
elif isinstance(t, ast.Parameter):
|
|
384
385
|
col = sa.column(t.value, is_literal=True)
|
|
385
386
|
if t.alias:
|
|
386
|
-
raise RenderError()
|
|
387
|
+
raise RenderError("Parameter aliases are not supported in the renderer")
|
|
387
388
|
elif isinstance(t, ast.Tuple):
|
|
388
389
|
col = [self.to_expression(i) for i in t.items]
|
|
389
390
|
elif isinstance(t, ast.Variable):
|
|
@@ -574,17 +575,18 @@ class SqlalchemyRender:
|
|
|
574
575
|
else:
|
|
575
576
|
condition = self.to_expression(item["condition"])
|
|
576
577
|
|
|
577
|
-
if "ASOF" in join_type:
|
|
578
|
+
if "ASOF" in join_type or "RIGHT" in join_type:
|
|
578
579
|
raise NotImplementedError(f"Unsupported join type: {join_type}")
|
|
579
|
-
|
|
580
|
+
|
|
580
581
|
is_full = False
|
|
581
|
-
|
|
582
|
-
|
|
582
|
+
is_outer = False
|
|
583
|
+
if join_type in ("LEFT JOIN", "LEFT OUTER JOIN"):
|
|
584
|
+
is_outer = True
|
|
583
585
|
if join_type == "FULL JOIN":
|
|
584
586
|
is_full = True
|
|
585
587
|
|
|
586
588
|
# perform join
|
|
587
|
-
query =
|
|
589
|
+
query = query.join(table, condition, isouter=is_outer, full=is_full)
|
|
588
590
|
elif isinstance(from_table, (ast.Union, ast.Intersect, ast.Except)):
|
|
589
591
|
alias = None
|
|
590
592
|
if from_table.alias:
|
mindsdb/utilities/starters.py
CHANGED
|
@@ -18,16 +18,6 @@ def start_mysql(*args, **kwargs):
|
|
|
18
18
|
start(*args, **kwargs)
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def start_postgres(*args, **kwargs):
|
|
22
|
-
from mindsdb.utilities.log import initialize_logging
|
|
23
|
-
|
|
24
|
-
initialize_logging("postgres")
|
|
25
|
-
|
|
26
|
-
from mindsdb.api.postgres.start import start
|
|
27
|
-
|
|
28
|
-
start(*args, **kwargs)
|
|
29
|
-
|
|
30
|
-
|
|
31
21
|
def start_tasks(*args, **kwargs):
|
|
32
22
|
from mindsdb.utilities.log import initialize_logging
|
|
33
23
|
|
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
|