Skip to content

Commit 4eb7a3e

Browse files
committed
Fix schema_name filter in table-description repository
1 parent ef9e4e6 commit 4eb7a3e

File tree

1 file changed

+9
-5
lines changed
  • dataherald/db_scanner/repository

1 file changed

+9
-5
lines changed

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@ def save_table_info(self, table_info: TableDescription) -> TableDescription:
5353
table_info_dict = {
5454
k: v for k, v in table_info_dict.items() if v is not None and v != []
5555
}
56+
57+
query = {
58+
"db_connection_id": table_info_dict["db_connection_id"],
59+
"table_name": table_info_dict["table_name"],
60+
}
61+
if "schema_name" in table_info_dict:
62+
query["schema_name"] = table_info_dict["schema_name"]
63+
5664
table_info.id = str(
5765
self.storage.update_or_create(
5866
DB_COLLECTION,
59-
{
60-
"db_connection_id": table_info_dict["db_connection_id"],
61-
"table_name": table_info_dict["table_name"],
62-
"schema_name": table_info_dict["schema_name"],
63-
},
67+
query,
6468
table_info_dict,
6569
)
6670
)

0 commit comments

Comments
 (0)