Skip to content

Commit ef9e4e6

Browse files
committed
Fix table-description storage
1 parent 8493438 commit ef9e4e6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: dataherald/db_scanner/repository/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def save_table_info(self, table_info: TableDescription) -> TableDescription:
5959
{
6060
"db_connection_id": table_info_dict["db_connection_id"],
6161
"table_name": table_info_dict["table_name"],
62+
"schema_name": table_info_dict["schema_name"],
6263
},
6364
table_info_dict,
6465
)

Diff for: dataherald/db_scanner/sqlalchemy.py

+5
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def synchronizing(
112112
table_name=table_description.table_name,
113113
status=TableDescriptionStatus.SYNCHRONIZING.value,
114114
metadata=scanner_request.metadata,
115+
schema_name=table_description.schema_name,
115116
)
116117
)
117118
)
@@ -241,6 +242,7 @@ def scan_single_table(
241242
db_connection_id: str,
242243
repository: TableDescriptionRepository,
243244
scanner_service: AbstractScanner,
245+
schema: str | None = None,
244246
) -> TableDescription:
245247
print(f"Scanning table: {table}")
246248
inspector = inspect(db_engine.engine)
@@ -273,6 +275,7 @@ def scan_single_table(
273275
last_schema_sync=datetime.now(),
274276
error_message="",
275277
status=TableDescriptionStatus.SCANNED.value,
278+
schema_name=schema,
276279
)
277280

278281
repository.save_table_info(object)
@@ -311,6 +314,7 @@ def scan(
311314
db_connection_id=table.db_connection_id,
312315
repository=repository,
313316
scanner_service=scanner_service,
317+
schema=table.schema_name,
314318
)
315319
except Exception as e:
316320
repository.save_table_info(
@@ -319,6 +323,7 @@ def scan(
319323
table_name=table,
320324
status=TableDescriptionStatus.FAILED.value,
321325
error_message=f"{e}",
326+
schema_name=table.schema_name,
322327
)
323328
)
324329
try:

0 commit comments

Comments
 (0)