Skip to content

Commit 7626ac9

Browse files
Fix importing issues (#9)
1 parent c088bb8 commit 7626ac9

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [0.0.2](https://github.com/Datuanalytics/datu-core/tree/0.0.2) - 2025-08-18
2+
3+
### Changed
4+
5+
- Packaging changes
6+
7+
18
## [0.0.1](https://github.com/Datuanalytics/datu-core/tree/0.0.1) - 2025-08-18
29

310
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ python -m venv .venv
5454
source .venv/bin/activate # On Windows use: .venv\Scripts\activate
5555

5656
#Install datu core
57-
pip install datu-core
57+
pip install 'datu-core[all]'
5858

5959
```
6060

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ dependencies = [
2323
"langchain-openai>=0.3,<0.4",
2424
"pydantic-settings>=2.8.1",
2525
"types-psycopg2>=2.9.21.20250318",
26-
"dbt-core>=1.9.3",
2726
"types-pyyaml>=6.0.12.20250402",
2827
"sql-metadata>=2.17.0",
2928
"sentence-transformers>=2.5.1",
@@ -69,7 +68,6 @@ dev = [
6968
]
7069
postgres = [
7170
"psycopg2-binary>=2.9.6",
72-
"dbt-postgres>=1.9.0",
7371
]
7472
sqldb = [
7573
"pyodbc>=5.2.0",
@@ -84,6 +82,13 @@ docs = [
8482
"mkdocs-macros-plugin~=1.3.7",
8583
"mkdocstrings-python~=1.16.10"
8684
]
85+
all = [
86+
# postgres
87+
"psycopg2-binary>=2.9.6",
88+
89+
#sqldb
90+
"pyodbc>=5.2.0",
91+
]
8792

8893
[[project.maintainers]]
8994
name = "Datu"

src/datu/factory/db_connector.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Factory class to create database connectors based on dbt profiles"""
22

33
from datu.integrations.dbt.config import get_dbt_profiles_settings
4-
from datu.integrations.postgre_sql.postgre_connector import PostgreSQLConnector
5-
from datu.integrations.sql_server.sqldb_connector import SQLServerConnector
64

75

86
class DBConnectorFactory:
@@ -39,8 +37,12 @@ def get_connector(
3937
db_type = config.type
4038

4139
if db_type == "postgres":
40+
from datu.integrations.postgre_sql.postgre_connector import PostgreSQLConnector
41+
4242
return PostgreSQLConnector(config)
4343
elif db_type == "sqlserver":
44+
from datu.integrations.sql_server.sqldb_connector import SQLServerConnector
45+
4446
return SQLServerConnector(config)
4547
else:
4648
raise ValueError(f"Unsupported database type: {db_type}")

tests/services/test_graph_rag.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def clean_test_graph_cache():
2121
shutil.rmtree(TEST_GRAPH_DIR)
2222
os.makedirs(TEST_GRAPH_DIR)
2323
yield
24-
shutil.rmtree(TEST_GRAPH_DIR)
24+
if os.path.exists(TEST_GRAPH_DIR):
25+
shutil.rmtree(TEST_GRAPH_DIR)
2526

2627

2728
def test_init_with_dict_schema():
@@ -82,21 +83,6 @@ def test_initialize_graph_rebuild_and_cache():
8283
assert set(builder2.graph.edges) == set(builder.graph.edges)
8384

8485

85-
def test_graph_contains_expected_edges():
86-
"""Verify specific graph edges exist after initialization and triple extraction."""
87-
schema = SchemaTestFixtures.sample_schema()
88-
extractor = SchemaTripleExtractor(schema)
89-
extractor.create_schema_triples()
90-
builder = SchemaGraphBuilder(triples=extractor.triples, is_rag_outdated=True)
91-
builder.initialize_graph()
92-
test_graph = builder.graph
93-
94-
assert test_graph.has_edge("orders", "order_id")
95-
assert test_graph.has_edge("order_id", "int") or any(
96-
d["label"] == "has_data_type" for _, _, d in test_graph.edges(data=True)
97-
)
98-
99-
10086
@pytest.mark.requires_service
10187
def test_schema_rag_run_query_returns_filtered_schema_dict():
10288
"""Test SchemaRAG end-to-end run_query method returns filtered schema."""

0 commit comments

Comments
 (0)