datus-sqlalchemy 0.1.2__tar.gz → 0.1.3__tar.gz

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.
@@ -135,3 +135,6 @@ dmypy.json
135
135
  # OS
136
136
  .DS_Store
137
137
  Thumbs.db
138
+
139
+
140
+ .omc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datus-sqlalchemy
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: SQLAlchemy base connector for Datus database adapters
5
5
  Project-URL: Homepage, https://github.com/Datus-ai/datus-db-adapters
6
6
  Project-URL: Repository, https://github.com/Datus-ai/datus-db-adapters
@@ -14,7 +14,7 @@ Classifier: License :: OSI Approved :: Apache Software License
14
14
  Classifier: Programming Language :: Python :: 3
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Requires-Python: >=3.12
17
- Requires-Dist: datus-agent>0.2.1
17
+ Requires-Dist: datus-agent>0.2.5
18
18
  Requires-Dist: pandas>=2.1.4
19
19
  Requires-Dist: pyarrow<19.0.0,>=14.0.0
20
20
  Requires-Dist: sqlalchemy>=2.0.23
@@ -51,7 +51,7 @@ class SQLAlchemyConnector(BaseSqlConnector):
51
51
  # Auto-detect dialect from connection string if not provided
52
52
  if not dialect:
53
53
  prefix = connection_string.split(":")[0] if isinstance(connection_string, str) else "unknown"
54
- dialect = DBType.MYSQL if prefix == "mysql+pymysql" else prefix
54
+ dialect = "mysql" if prefix == "mysql+pymysql" else prefix
55
55
 
56
56
  config = ConnectionConfig(timeout_seconds=timeout_seconds)
57
57
  super().__init__(config, dialect)
@@ -257,8 +257,10 @@ class SQLAlchemyConnector(BaseSqlConnector):
257
257
  rows = result.fetchall()
258
258
  return [row._asdict() for row in rows]
259
259
  except DatusException:
260
+ self._safe_rollback()
260
261
  raise
261
262
  except Exception as e:
263
+ self._safe_rollback()
262
264
  raise self._handle_exception(e, sql, "query") from e
263
265
 
264
266
  @override
@@ -392,7 +394,7 @@ class SQLAlchemyConnector(BaseSqlConnector):
392
394
  conn.commit()
393
395
 
394
396
  # Update context if applicable
395
- if self.dialect != DBType.SQLITE.value:
397
+ if self.dialect != "sqlite":
396
398
  context = parse_context_switch(sql=sql, dialect=self.dialect)
397
399
  if context:
398
400
  if catalog := context.get("catalog_name"):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "datus-sqlalchemy"
3
- version = "0.1.2"
3
+ version = "0.1.3"
4
4
  description = "SQLAlchemy base connector for Datus database adapters"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -18,7 +18,7 @@ classifiers = [
18
18
  ]
19
19
 
20
20
  dependencies = [
21
- "datus-agent>0.2.1",
21
+ "datus-agent>0.2.5",
22
22
  "sqlalchemy>=2.0.23",
23
23
  "pyarrow>=14.0.0,<19.0.0",
24
24
  "pandas>=2.1.4",