MindsDB 25.9.3rc1__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.

Files changed (90) hide show
  1. mindsdb/__about__.py +1 -1
  2. mindsdb/__main__.py +1 -9
  3. mindsdb/api/a2a/__init__.py +1 -1
  4. mindsdb/api/a2a/agent.py +9 -1
  5. mindsdb/api/a2a/common/server/server.py +4 -0
  6. mindsdb/api/a2a/common/server/task_manager.py +8 -1
  7. mindsdb/api/a2a/common/types.py +66 -0
  8. mindsdb/api/a2a/task_manager.py +50 -0
  9. mindsdb/api/common/middleware.py +1 -1
  10. mindsdb/api/executor/command_executor.py +49 -36
  11. mindsdb/api/executor/datahub/datanodes/information_schema_datanode.py +7 -13
  12. mindsdb/api/executor/datahub/datanodes/integration_datanode.py +2 -2
  13. mindsdb/api/executor/datahub/datanodes/system_tables.py +2 -1
  14. mindsdb/api/executor/planner/query_prepare.py +2 -20
  15. mindsdb/api/executor/utilities/sql.py +5 -4
  16. mindsdb/api/http/initialize.py +76 -60
  17. mindsdb/api/http/namespaces/agents.py +0 -3
  18. mindsdb/api/http/namespaces/chatbots.py +0 -5
  19. mindsdb/api/http/namespaces/file.py +2 -0
  20. mindsdb/api/http/namespaces/handlers.py +10 -5
  21. mindsdb/api/http/namespaces/knowledge_bases.py +20 -0
  22. mindsdb/api/http/namespaces/sql.py +2 -2
  23. mindsdb/api/http/start.py +2 -2
  24. mindsdb/api/mysql/mysql_proxy/utilities/dump.py +8 -2
  25. mindsdb/integrations/handlers/byom_handler/byom_handler.py +2 -10
  26. mindsdb/integrations/handlers/databricks_handler/databricks_handler.py +98 -46
  27. mindsdb/integrations/handlers/druid_handler/druid_handler.py +32 -40
  28. mindsdb/integrations/handlers/gitlab_handler/gitlab_handler.py +5 -2
  29. mindsdb/integrations/handlers/mssql_handler/mssql_handler.py +438 -100
  30. mindsdb/integrations/handlers/mssql_handler/requirements_odbc.txt +3 -0
  31. mindsdb/integrations/handlers/mysql_handler/mysql_handler.py +235 -3
  32. mindsdb/integrations/handlers/oracle_handler/__init__.py +2 -0
  33. mindsdb/integrations/handlers/oracle_handler/connection_args.py +7 -1
  34. mindsdb/integrations/handlers/oracle_handler/oracle_handler.py +321 -16
  35. mindsdb/integrations/handlers/oracle_handler/requirements.txt +1 -1
  36. mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +2 -2
  37. mindsdb/integrations/handlers/shopify_handler/requirements.txt +1 -0
  38. mindsdb/integrations/handlers/shopify_handler/shopify_handler.py +57 -3
  39. mindsdb/integrations/handlers/zendesk_handler/zendesk_tables.py +144 -111
  40. mindsdb/integrations/libs/response.py +2 -2
  41. mindsdb/integrations/utilities/handlers/auth_utilities/snowflake/__init__.py +1 -0
  42. mindsdb/integrations/utilities/handlers/auth_utilities/snowflake/snowflake_jwt_gen.py +151 -0
  43. mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +24 -21
  44. mindsdb/interfaces/agents/agents_controller.py +0 -2
  45. mindsdb/interfaces/data_catalog/data_catalog_loader.py +6 -7
  46. mindsdb/interfaces/data_catalog/data_catalog_reader.py +15 -4
  47. mindsdb/interfaces/database/data_handlers_cache.py +190 -0
  48. mindsdb/interfaces/database/database.py +3 -3
  49. mindsdb/interfaces/database/integrations.py +1 -121
  50. mindsdb/interfaces/database/projects.py +2 -6
  51. mindsdb/interfaces/database/views.py +1 -4
  52. mindsdb/interfaces/jobs/jobs_controller.py +0 -4
  53. mindsdb/interfaces/jobs/scheduler.py +0 -1
  54. mindsdb/interfaces/knowledge_base/controller.py +197 -108
  55. mindsdb/interfaces/knowledge_base/evaluate.py +36 -41
  56. mindsdb/interfaces/knowledge_base/executor.py +11 -0
  57. mindsdb/interfaces/knowledge_base/llm_client.py +51 -17
  58. mindsdb/interfaces/model/model_controller.py +4 -4
  59. mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +4 -10
  60. mindsdb/interfaces/skills/skills_controller.py +1 -4
  61. mindsdb/interfaces/storage/db.py +16 -6
  62. mindsdb/interfaces/triggers/triggers_controller.py +1 -3
  63. mindsdb/utilities/config.py +19 -2
  64. mindsdb/utilities/exception.py +2 -2
  65. mindsdb/utilities/json_encoder.py +24 -10
  66. mindsdb/utilities/render/sqlalchemy_render.py +15 -14
  67. mindsdb/utilities/starters.py +0 -10
  68. {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0.dist-info}/METADATA +278 -264
  69. {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0.dist-info}/RECORD +72 -86
  70. mindsdb/api/postgres/__init__.py +0 -0
  71. mindsdb/api/postgres/postgres_proxy/__init__.py +0 -0
  72. mindsdb/api/postgres/postgres_proxy/executor/__init__.py +0 -1
  73. mindsdb/api/postgres/postgres_proxy/executor/executor.py +0 -182
  74. mindsdb/api/postgres/postgres_proxy/postgres_packets/__init__.py +0 -0
  75. mindsdb/api/postgres/postgres_proxy/postgres_packets/errors.py +0 -322
  76. mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_fields.py +0 -34
  77. mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message.py +0 -31
  78. mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_formats.py +0 -1265
  79. mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_message_identifiers.py +0 -31
  80. mindsdb/api/postgres/postgres_proxy/postgres_packets/postgres_packets.py +0 -265
  81. mindsdb/api/postgres/postgres_proxy/postgres_proxy.py +0 -477
  82. mindsdb/api/postgres/postgres_proxy/utilities/__init__.py +0 -10
  83. mindsdb/api/postgres/start.py +0 -11
  84. mindsdb/integrations/handlers/mssql_handler/tests/__init__.py +0 -0
  85. mindsdb/integrations/handlers/mssql_handler/tests/test_mssql_handler.py +0 -169
  86. mindsdb/integrations/handlers/oracle_handler/tests/__init__.py +0 -0
  87. mindsdb/integrations/handlers/oracle_handler/tests/test_oracle_handler.py +0 -32
  88. {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0.dist-info}/WHEEL +0 -0
  89. {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0.dist-info}/licenses/LICENSE +0 -0
  90. {mindsdb-25.9.3rc1.dist-info → mindsdb-25.10.0.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.ast.base import ASTNode
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 = 'druid'
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 = 'druid'
40
+ self.dialect = "druid"
41
41
 
42
- optional_parameters = ['user', 'password']
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 'path' not in connection_data:
48
- connection_data['path'] = '/druid/v2/sql/'
47
+ if "path" not in connection_data:
48
+ connection_data["path"] = "/druid/v2/sql/"
49
49
 
50
- if 'scheme' not in connection_data:
51
- connection_data['scheme'] = 'http'
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['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']
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('select 1') # raise exception if provided wrong credentials
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'Error connecting to Druid, {e}!')
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'Error running query: {query} on Pinot!')
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" = 'druid' AND "TABLE_NAME" = '{table_name}'
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
- """ constructor
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
- """ Set up the connections required by the handler
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