Skip to content

Commit

Permalink
Fix schema_name filter in table-description repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jcjc712 committed Apr 24, 2024
1 parent ef9e4e6 commit 4eb7a3e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dataherald/db_scanner/repository/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,18 @@ def save_table_info(self, table_info: TableDescription) -> TableDescription:
table_info_dict = {
k: v for k, v in table_info_dict.items() if v is not None and v != []
}

query = {
"db_connection_id": table_info_dict["db_connection_id"],
"table_name": table_info_dict["table_name"],
}
if "schema_name" in table_info_dict:
query["schema_name"] = table_info_dict["schema_name"]

table_info.id = str(
self.storage.update_or_create(
DB_COLLECTION,
{
"db_connection_id": table_info_dict["db_connection_id"],
"table_name": table_info_dict["table_name"],
"schema_name": table_info_dict["schema_name"],
},
query,
table_info_dict,
)
)
Expand Down

0 comments on commit 4eb7a3e

Please sign in to comment.