MindsDB 25.3.4.0__py3-none-any.whl → 25.3.4.2__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 (32) hide show
  1. mindsdb/__about__.py +2 -2
  2. mindsdb/api/executor/datahub/datanodes/integration_datanode.py +5 -2
  3. mindsdb/api/executor/datahub/datanodes/system_tables.py +131 -138
  4. mindsdb/api/mysql/mysql_proxy/libs/constants/mysql.py +74 -0
  5. mindsdb/integrations/handlers/confluence_handler/confluence_api_client.py +176 -0
  6. mindsdb/integrations/handlers/confluence_handler/confluence_handler.py +54 -59
  7. mindsdb/integrations/handlers/confluence_handler/confluence_tables.py +753 -0
  8. mindsdb/integrations/handlers/confluence_handler/connection_args.py +8 -8
  9. mindsdb/integrations/handlers/langchain_handler/requirements.txt +1 -1
  10. mindsdb/integrations/handlers/lightwood_handler/requirements.txt +3 -3
  11. mindsdb/integrations/handlers/litellm_handler/requirements.txt +1 -1
  12. mindsdb/integrations/handlers/llama_index_handler/requirements.txt +1 -1
  13. mindsdb/integrations/handlers/ms_teams_handler/ms_graph_api_teams_client.py +278 -55
  14. mindsdb/integrations/handlers/ms_teams_handler/ms_teams_handler.py +52 -21
  15. mindsdb/integrations/handlers/ms_teams_handler/ms_teams_tables.py +6 -29
  16. mindsdb/integrations/handlers/mssql_handler/mssql_handler.py +37 -1
  17. mindsdb/integrations/handlers/mysql_handler/mysql_handler.py +30 -1
  18. mindsdb/integrations/handlers/oracle_handler/oracle_handler.py +53 -5
  19. mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +37 -1
  20. mindsdb/integrations/handlers/ray_serve_handler/ray_serve_handler.py +18 -16
  21. mindsdb/integrations/handlers/snowflake_handler/snowflake_handler.py +68 -2
  22. mindsdb/integrations/utilities/handlers/auth_utilities/__init__.py +1 -1
  23. mindsdb/integrations/utilities/handlers/auth_utilities/microsoft/__init__.py +1 -1
  24. mindsdb/integrations/utilities/handlers/auth_utilities/microsoft/ms_graph_api_auth_utilities.py +97 -18
  25. mindsdb/utilities/render/sqlalchemy_render.py +30 -6
  26. {mindsdb-25.3.4.0.dist-info → mindsdb-25.3.4.2.dist-info}/METADATA +226 -231
  27. {mindsdb-25.3.4.0.dist-info → mindsdb-25.3.4.2.dist-info}/RECORD +30 -30
  28. {mindsdb-25.3.4.0.dist-info → mindsdb-25.3.4.2.dist-info}/WHEEL +1 -1
  29. mindsdb/integrations/handlers/confluence_handler/confluence_table.py +0 -193
  30. mindsdb/integrations/handlers/confluence_handler/requirements.txt +0 -1
  31. {mindsdb-25.3.4.0.dist-info → mindsdb-25.3.4.2.dist-info}/licenses/LICENSE +0 -0
  32. {mindsdb-25.3.4.0.dist-info → mindsdb-25.3.4.2.dist-info}/top_level.txt +0 -0
@@ -1,83 +1,92 @@
1
- from typing import Optional, Union
1
+ from typing import Any, Dict
2
2
 
3
- import requests
4
- from atlassian import Confluence
5
- from mindsdb_sql_parser import parse_sql
6
-
7
- from mindsdb.integrations.handlers.confluence_handler.confluence_table import (
3
+ from mindsdb.integrations.handlers.confluence_handler.confluence_api_client import ConfluenceAPIClient
4
+ from mindsdb.integrations.handlers.confluence_handler.confluence_tables import (
5
+ ConfluenceBlogPostsTable,
6
+ ConfluenceDatabasesTable,
8
7
  ConfluencePagesTable,
8
+ ConfluenceSpacesTable,
9
+ ConfluenceTasksTable,
10
+ ConfluenceWhiteboardsTable,
9
11
  )
10
12
  from mindsdb.integrations.libs.api_handler import APIHandler
11
13
  from mindsdb.integrations.libs.response import (
12
14
  HandlerStatusResponse as StatusResponse,
13
15
  )
14
- from mindsdb_sql_parser import parse_sql
15
16
  from mindsdb.utilities import log
16
17
 
17
- from atlassian import Confluence
18
- from typing import Optional
19
- import requests
20
18
 
21
19
  logger = log.getLogger(__name__)
22
20
 
21
+
23
22
  class ConfluenceHandler(APIHandler):
24
- """Confluence handler implementation"""
25
-
26
- def __init__(self, name=None, **kwargs):
27
- """Initialize the Confluence handler.
28
- Parameters
29
- ----------
30
- name : str
31
- name of a handler instance
32
- """
33
- super().__init__(name)
23
+ """
24
+ This handler handles the connection and execution of SQL statements on Confluence.
25
+ """
26
+
27
+ name = "confluence"
34
28
 
35
- connection_data = kwargs.get("connection_data", {})
29
+ def __init__(self, name: str, connection_data: Dict, **kwargs: Any) -> None:
30
+ """
31
+ Initializes the handler.
36
32
 
37
- self.parser = parse_sql
38
- self.dialect = 'confluence'
33
+ Args:
34
+ name (str): The name of the handler instance.
35
+ connection_data (Dict): The connection data required to connect to the Confluence API.
36
+ kwargs: Arbitrary keyword arguments.
37
+ """
38
+ super().__init__(name)
39
39
  self.connection_data = connection_data
40
40
  self.kwargs = kwargs
41
+
41
42
  self.connection = None
42
43
  self.is_connected = False
44
+ self.thread_safe = True
43
45
 
44
- confluence_pages_data = ConfluencePagesTable(self)
45
- self._register_table("pages", confluence_pages_data)
46
+ self._register_table("spaces", ConfluenceSpacesTable(self))
47
+ self._register_table("pages", ConfluencePagesTable(self))
48
+ self._register_table("blogposts", ConfluenceBlogPostsTable(self))
49
+ self._register_table("whiteboards", ConfluenceWhiteboardsTable(self))
50
+ self._register_table("databases", ConfluenceDatabasesTable(self))
51
+ self._register_table("tasks", ConfluenceTasksTable(self))
46
52
 
47
- def connect(self):
48
- """Set up the connection required by the handler.
49
- Returns
50
- -------
51
- StatusResponse
52
- connection object
53
+ def connect(self) -> ConfluenceAPIClient:
54
+ """
55
+ Establishes a connection to the Confluence API.
56
+
57
+ Raises:
58
+ ValueError: If the required connection parameters are not provided.
59
+
60
+ Returns:
61
+ atlassian.confluence.Confluence: A connection object to the Confluence API.
53
62
  """
54
63
  if self.is_connected is True:
55
64
  return self.connection
56
-
57
- if not all(key in self.connection_data and self.connection_data.get(key) for key in ['url', 'username', 'password']):
58
- raise ValueError('Required parameters (url, username, password) must be provided and should not be empty.')
59
-
60
- conf = Confluence(
61
- url=self.connection_data.get('url'),
65
+
66
+ if not all(key in self.connection_data and self.connection_data.get(key) for key in ['api_base', 'username', 'password']):
67
+ raise ValueError('Required parameters (api_base, username, password) must be provided and should not be empty.')
68
+
69
+ self.connection = ConfluenceAPIClient(
70
+ url=self.connection_data.get('api_base'),
62
71
  username=self.connection_data.get('username'),
63
72
  password=self.connection_data.get('password'),
64
73
  )
65
- self.connection = conf
74
+
66
75
  self.is_connected = True
67
76
  return self.connection
68
77
 
69
78
  def check_connection(self) -> StatusResponse:
70
- """Check connection to the handler.
71
- Returns
72
- -------
73
- StatusResponse
74
- Status confirmation
79
+ """
80
+ Checks the status of the connection to the Confluence API.
81
+
82
+ Returns:
83
+ StatusResponse: An object containing the success status and an error message if an error occurs.
75
84
  """
76
85
  response = StatusResponse(False)
77
- need_to_close = self.is_connected is False
78
86
 
79
87
  try:
80
- self.connect()
88
+ connection = self.connect()
89
+ connection.get_spaces(limit=1)
81
90
  response.success = True
82
91
  except Exception as e:
83
92
  logger.error(f"Error connecting to Confluence API: {e}!")
@@ -86,17 +95,3 @@ class ConfluenceHandler(APIHandler):
86
95
  self.is_connected = response.success
87
96
 
88
97
  return response
89
-
90
- def native_query(self, query: str) -> StatusResponse:
91
- """Receive and process a raw query.
92
- Parameters
93
- ----------
94
- query : str
95
- query in a native format
96
- Returns
97
- -------
98
- StatusResponse
99
- Request status
100
- """
101
- ast = parse_sql(query)
102
- return self.query(ast)