datus-postgresql 0.1.1__tar.gz → 0.1.2__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.
Files changed (19) hide show
  1. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/PKG-INFO +2 -2
  2. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/datus_postgresql/__init__.py +1 -1
  3. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/datus_postgresql/connector.py +2 -5
  4. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/pyproject.toml +3 -2
  5. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/unit/test_connector_unit.py +2 -2
  6. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/.gitignore +0 -0
  7. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/README.md +0 -0
  8. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/datus_postgresql/config.py +0 -0
  9. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/datus_postgresql/handlers.py +0 -0
  10. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/docker-compose.yml +0 -0
  11. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/scripts/init_tpch_data.py +0 -0
  12. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/__init__.py +0 -0
  13. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/conftest.py +0 -0
  14. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/integration/__init__.py +0 -0
  15. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/integration/conftest.py +0 -0
  16. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/integration/test_integration.py +0 -0
  17. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/integration/test_tpch.py +0 -0
  18. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/unit/__init__.py +0 -0
  19. {datus_postgresql-0.1.1 → datus_postgresql-0.1.2}/tests/unit/test_config.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datus-postgresql
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: PostgreSQL database adapter for Datus
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.5
17
+ Requires-Dist: datus-db-core>=0.1.0
18
18
  Requires-Dist: datus-sqlalchemy>=0.1.2
19
19
  Requires-Dist: psycopg2-binary>=2.9.11
20
20
  Requires-Dist: pydantic>=2.0.0
@@ -11,7 +11,7 @@ __all__ = ["PostgreSQLConnector", "PostgreSQLConfig", "register"]
11
11
 
12
12
  def register():
13
13
  """Register PostgreSQL connector with Datus registry."""
14
- from datus.tools.db_tools import connector_registry
14
+ from datus_db_core import connector_registry
15
15
 
16
16
  from .handlers import build_postgresql_uri, resolve_postgresql_context
17
17
 
@@ -5,10 +5,7 @@
5
5
  from typing import Any, Dict, List, Optional, Set, Union, override
6
6
  from urllib.parse import quote_plus
7
7
 
8
- from datus.schemas.base import TABLE_TYPE
9
- from datus.tools.db_tools.base import list_to_in_str
10
- from datus.utils.exceptions import DatusException, ErrorCode
11
- from datus.utils.loggings import get_logger
8
+ from datus_db_core import TABLE_TYPE, DatusDbException, ErrorCode, get_logger, list_to_in_str
12
9
  from datus_sqlalchemy import SQLAlchemyConnector
13
10
  from pydantic import BaseModel, Field
14
11
 
@@ -42,7 +39,7 @@ METADATA_DICT: Dict[TABLE_TYPE, TableMetadataNames] = {
42
39
  def _get_metadata_config(table_type: TABLE_TYPE) -> TableMetadataNames:
43
40
  """Get metadata configuration for given table type."""
44
41
  if table_type not in METADATA_DICT:
45
- raise DatusException(ErrorCode.COMMON_FIELD_INVALID, f"Invalid table type '{table_type}'")
42
+ raise DatusDbException(ErrorCode.COMMON_FIELD_INVALID, f"Invalid table type '{table_type}'")
46
43
  return METADATA_DICT[table_type]
47
44
 
48
45
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "datus-postgresql"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "PostgreSQL database adapter for Datus"
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.5",
21
+ "datus-db-core>=0.1.0",
22
22
  "datus-sqlalchemy>=0.1.2",
23
23
  "psycopg2-binary>=2.9.11",
24
24
  "pydantic>=2.0.0",
@@ -33,6 +33,7 @@ Issues = "https://github.com/Datus-ai/datus-db-adapters/issues"
33
33
  postgresql = "datus_postgresql:register"
34
34
 
35
35
  [tool.uv.sources]
36
+ datus-db-core = { workspace = true }
36
37
  datus-sqlalchemy = { workspace = true }
37
38
 
38
39
  [build-system]
@@ -5,7 +5,7 @@
5
5
  from unittest.mock import patch
6
6
 
7
7
  import pytest
8
- from datus.utils.exceptions import DatusException
8
+ from datus_db_core import DatusDbException
9
9
  from datus_postgresql import PostgreSQLConfig, PostgreSQLConnector
10
10
 
11
11
 
@@ -308,7 +308,7 @@ def test_get_metadata_config_invalid_type():
308
308
  """Test _get_metadata_config with invalid table type."""
309
309
  from datus_postgresql.connector import _get_metadata_config
310
310
 
311
- with pytest.raises(DatusException, match="Invalid table type"):
311
+ with pytest.raises(DatusDbException, match="Invalid table type"):
312
312
  _get_metadata_config("invalid_type")
313
313
 
314
314