MindsDB 25.9.3rc1__py3-none-any.whl → 25.10.0rc1__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 +1 -9
- mindsdb/api/a2a/__init__.py +1 -1
- mindsdb/api/a2a/agent.py +9 -1
- mindsdb/api/a2a/common/server/server.py +4 -0
- mindsdb/api/a2a/common/server/task_manager.py +8 -1
- mindsdb/api/a2a/common/types.py +66 -0
- mindsdb/api/a2a/task_manager.py +50 -0
- mindsdb/api/common/middleware.py +1 -1
- mindsdb/api/executor/command_executor.py +49 -36
- mindsdb/api/executor/datahub/datanodes/information_schema_datanode.py +7 -13
- mindsdb/api/executor/datahub/datanodes/integration_datanode.py +2 -2
- mindsdb/api/executor/datahub/datanodes/system_tables.py +2 -1
- mindsdb/api/executor/planner/query_prepare.py +2 -20
- mindsdb/api/executor/utilities/sql.py +5 -4
- mindsdb/api/http/initialize.py +76 -60
- mindsdb/api/http/namespaces/agents.py +0 -3
- mindsdb/api/http/namespaces/chatbots.py +0 -5
- mindsdb/api/http/namespaces/file.py +2 -0
- mindsdb/api/http/namespaces/handlers.py +10 -5
- mindsdb/api/http/namespaces/knowledge_bases.py +20 -0
- mindsdb/api/http/namespaces/sql.py +2 -2
- mindsdb/api/http/start.py +2 -2
- mindsdb/api/mysql/mysql_proxy/utilities/dump.py +8 -2
- mindsdb/integrations/handlers/byom_handler/byom_handler.py +2 -10
- mindsdb/integrations/handlers/databricks_handler/databricks_handler.py +98 -46
- mindsdb/integrations/handlers/druid_handler/druid_handler.py +32 -40
- mindsdb/integrations/handlers/gitlab_handler/gitlab_handler.py +5 -2
- 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 +2 -2
- mindsdb/integrations/handlers/zendesk_handler/zendesk_tables.py +144 -111
- mindsdb/integrations/libs/response.py +2 -2
- 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/rerankers/base_reranker.py +24 -21
- mindsdb/interfaces/agents/agents_controller.py +0 -2
- mindsdb/interfaces/data_catalog/data_catalog_loader.py +6 -7
- 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 +1 -121
- mindsdb/interfaces/database/projects.py +2 -6
- mindsdb/interfaces/database/views.py +1 -4
- mindsdb/interfaces/jobs/jobs_controller.py +0 -4
- mindsdb/interfaces/jobs/scheduler.py +0 -1
- mindsdb/interfaces/knowledge_base/controller.py +197 -108
- 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/model/model_controller.py +4 -4
- mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +4 -10
- mindsdb/interfaces/skills/skills_controller.py +1 -4
- mindsdb/interfaces/storage/db.py +16 -6
- mindsdb/interfaces/triggers/triggers_controller.py +1 -3
- mindsdb/utilities/config.py +19 -2
- mindsdb/utilities/exception.py +2 -2
- mindsdb/utilities/json_encoder.py +24 -10
- mindsdb/utilities/render/sqlalchemy_render.py +15 -14
- mindsdb/utilities/starters.py +0 -10
- {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0rc1.dist-info}/METADATA +276 -264
- {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0rc1.dist-info}/RECORD +70 -84
- 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 -182
- 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 -265
- 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.3rc1.dist-info → mindsdb-25.10.0rc1.dist-info}/WHEEL +0 -0
- {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0rc1.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0rc1.dist-info}/top_level.txt +0 -0
|
@@ -8,13 +8,13 @@ from mindsdb.utilities.render.sqlalchemy_render import SqlalchemyRender
|
|
|
8
8
|
from mindsdb.integrations.libs.base import DatabaseHandler
|
|
9
9
|
from pydruid.db.sqlalchemy import DruidDialect
|
|
10
10
|
|
|
11
|
-
from mindsdb_sql_parser
|
|
11
|
+
from mindsdb_sql_parser import ASTNode
|
|
12
12
|
|
|
13
13
|
from mindsdb.utilities import log
|
|
14
14
|
from mindsdb.integrations.libs.response import (
|
|
15
15
|
HandlerStatusResponse as StatusResponse,
|
|
16
16
|
HandlerResponse as Response,
|
|
17
|
-
RESPONSE_TYPE
|
|
17
|
+
RESPONSE_TYPE,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
logger = log.getLogger(__name__)
|
|
@@ -25,7 +25,7 @@ class DruidHandler(DatabaseHandler):
|
|
|
25
25
|
This handler handles connection and execution of the Apache Druid statements.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
name =
|
|
28
|
+
name = "druid"
|
|
29
29
|
|
|
30
30
|
def __init__(self, name: str, connection_data: Optional[dict], **kwargs):
|
|
31
31
|
"""
|
|
@@ -37,18 +37,18 @@ class DruidHandler(DatabaseHandler):
|
|
|
37
37
|
"""
|
|
38
38
|
super().__init__(name)
|
|
39
39
|
self.parser = parse_sql
|
|
40
|
-
self.dialect =
|
|
40
|
+
self.dialect = "druid"
|
|
41
41
|
|
|
42
|
-
optional_parameters = [
|
|
42
|
+
optional_parameters = ["user", "password"]
|
|
43
43
|
for parameter in optional_parameters:
|
|
44
44
|
if parameter not in connection_data:
|
|
45
45
|
connection_data[parameter] = None
|
|
46
46
|
|
|
47
|
-
if
|
|
48
|
-
connection_data[
|
|
47
|
+
if "path" not in connection_data:
|
|
48
|
+
connection_data["path"] = "/druid/v2/sql/"
|
|
49
49
|
|
|
50
|
-
if
|
|
51
|
-
connection_data[
|
|
50
|
+
if "scheme" not in connection_data:
|
|
51
|
+
connection_data["scheme"] = "http"
|
|
52
52
|
|
|
53
53
|
self.connection_data = connection_data
|
|
54
54
|
self.kwargs = kwargs
|
|
@@ -71,12 +71,12 @@ class DruidHandler(DatabaseHandler):
|
|
|
71
71
|
return self.connection
|
|
72
72
|
|
|
73
73
|
self.connection = connect(
|
|
74
|
-
host=self.connection_data[
|
|
75
|
-
port=self.connection_data[
|
|
76
|
-
path=self.connection_data[
|
|
77
|
-
scheme=self.connection_data[
|
|
78
|
-
user=self.connection_data[
|
|
79
|
-
password=self.connection_data[
|
|
74
|
+
host=self.connection_data["host"],
|
|
75
|
+
port=self.connection_data["port"],
|
|
76
|
+
path=self.connection_data["path"],
|
|
77
|
+
scheme=self.connection_data["scheme"],
|
|
78
|
+
user=self.connection_data["user"],
|
|
79
|
+
password=self.connection_data["password"],
|
|
80
80
|
)
|
|
81
81
|
self.is_connected = True
|
|
82
82
|
|
|
@@ -106,11 +106,11 @@ class DruidHandler(DatabaseHandler):
|
|
|
106
106
|
|
|
107
107
|
try:
|
|
108
108
|
conn = self.connect()
|
|
109
|
-
conn.cursor().execute(
|
|
109
|
+
conn.cursor().execute("select 1") # raise exception if provided wrong credentials
|
|
110
110
|
|
|
111
111
|
response.success = True
|
|
112
112
|
except Exception as e:
|
|
113
|
-
logger.error(f
|
|
113
|
+
logger.error(f"Error connecting to Druid, {e}!")
|
|
114
114
|
response.error_message = str(e)
|
|
115
115
|
finally:
|
|
116
116
|
if response.success is True and need_to_close:
|
|
@@ -139,21 +139,14 @@ class DruidHandler(DatabaseHandler):
|
|
|
139
139
|
result = cursor.fetchall()
|
|
140
140
|
if result:
|
|
141
141
|
response = Response(
|
|
142
|
-
RESPONSE_TYPE.TABLE,
|
|
143
|
-
data_frame=pd.DataFrame(
|
|
144
|
-
result,
|
|
145
|
-
columns=[x[0] for x in cursor.description]
|
|
146
|
-
)
|
|
142
|
+
RESPONSE_TYPE.TABLE, data_frame=pd.DataFrame(result, columns=[x[0] for x in cursor.description])
|
|
147
143
|
)
|
|
148
144
|
else:
|
|
149
145
|
connection.commit()
|
|
150
146
|
response = Response(RESPONSE_TYPE.OK)
|
|
151
147
|
except Exception as e:
|
|
152
|
-
logger.error(f
|
|
153
|
-
response = Response(
|
|
154
|
-
RESPONSE_TYPE.ERROR,
|
|
155
|
-
error_message=str(e)
|
|
156
|
-
)
|
|
148
|
+
logger.error(f"Error running query: {query} on Pinot!")
|
|
149
|
+
response = Response(RESPONSE_TYPE.ERROR, error_message=str(e))
|
|
157
150
|
|
|
158
151
|
cursor.close()
|
|
159
152
|
if need_to_close is True:
|
|
@@ -182,18 +175,18 @@ class DruidHandler(DatabaseHandler):
|
|
|
182
175
|
"""
|
|
183
176
|
|
|
184
177
|
query = """
|
|
185
|
-
SELECT
|
|
178
|
+
SELECT
|
|
179
|
+
TABLE_SCHEMA AS table_schema,
|
|
180
|
+
TABLE_NAME AS table_name,
|
|
181
|
+
TABLE_TYPE AS table_type
|
|
186
182
|
FROM INFORMATION_SCHEMA.TABLES
|
|
183
|
+
WHERE TABLE_SCHEMA not in ('INFORMATION_SCHEMA', 'sys')
|
|
187
184
|
"""
|
|
188
185
|
result = self.native_query(query)
|
|
189
|
-
df = result.data_frame
|
|
190
|
-
|
|
191
|
-
df = df[['TABLE_NAME', 'TABLE_TYPE']]
|
|
192
|
-
result.data_frame = df.rename(columns={'TABLE_NAME': 'table_name', 'TABLE_TYPE': 'table_type'})
|
|
193
186
|
|
|
194
187
|
return result
|
|
195
188
|
|
|
196
|
-
def get_columns(self, table_name: str) -> StatusResponse:
|
|
189
|
+
def get_columns(self, table_name: str, schema_name: Optional[str] = None) -> StatusResponse:
|
|
197
190
|
"""
|
|
198
191
|
Returns a list of entity columns.
|
|
199
192
|
Args:
|
|
@@ -201,16 +194,15 @@ class DruidHandler(DatabaseHandler):
|
|
|
201
194
|
Returns:
|
|
202
195
|
HandlerResponse
|
|
203
196
|
"""
|
|
204
|
-
|
|
197
|
+
if schema_name is None:
|
|
198
|
+
schema_name = "druid"
|
|
205
199
|
query = f"""
|
|
206
|
-
SELECT
|
|
200
|
+
SELECT
|
|
201
|
+
COLUMN_NAME FIELD,
|
|
202
|
+
DATA_TYPE TYPE
|
|
207
203
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
208
|
-
WHERE "TABLE_SCHEMA" = '
|
|
204
|
+
WHERE "TABLE_SCHEMA" = '{schema_name}' AND "TABLE_NAME" = '{table_name}'
|
|
209
205
|
"""
|
|
210
206
|
result = self.native_query(query)
|
|
211
|
-
df = result.data_frame
|
|
212
|
-
|
|
213
|
-
df = df[['COLUMN_NAME', 'DATA_TYPE']]
|
|
214
|
-
result.data_frame = df.rename(columns={'COLUMN_NAME': 'column_name', 'DATA_TYPE': 'data_type'})
|
|
215
207
|
|
|
216
208
|
return result
|
|
@@ -16,7 +16,7 @@ class GitlabHandler(APIHandler):
|
|
|
16
16
|
"""The GitLab handler implementation"""
|
|
17
17
|
|
|
18
18
|
def __init__(self, name: str, **kwargs):
|
|
19
|
-
"""
|
|
19
|
+
"""constructor
|
|
20
20
|
Args:
|
|
21
21
|
name (str): the handler name
|
|
22
22
|
"""
|
|
@@ -36,13 +36,16 @@ class GitlabHandler(APIHandler):
|
|
|
36
36
|
self._register_table("merge_requests", gitlab_merge_requests_data)
|
|
37
37
|
|
|
38
38
|
def connect(self) -> StatusResponse:
|
|
39
|
-
"""
|
|
39
|
+
"""Set up the connections required by the handler
|
|
40
40
|
Returns:
|
|
41
41
|
HandlerStatusResponse
|
|
42
42
|
"""
|
|
43
43
|
|
|
44
44
|
connection_kwargs = {}
|
|
45
45
|
|
|
46
|
+
if self.connection_data.get("url", None):
|
|
47
|
+
connection_kwargs["url"] = self.connection_data["url"]
|
|
48
|
+
|
|
46
49
|
if self.connection_data.get("api_key", None):
|
|
47
50
|
connection_kwargs["private_token"] = self.connection_data["api_key"]
|
|
48
51
|
|