File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -64,23 +64,28 @@ def refresh_tables(
6464 metadata : dict = None ,
6565 ) -> list [TableDescription ]:
6666 stored_tables = repository .find_by ({"db_connection_id" : str (db_connection_id )})
67+ stored_tables_list = [table .table_name for table in stored_tables ]
6768
6869 rows = []
6970 for table_description in stored_tables :
7071 if table_description .table_name not in tables :
7172 table_description .status = TableDescriptionStatus .DEPRECATED .value
7273 rows .append (repository .save_table_info (table_description ))
74+ else :
75+ rows .append (TableDescription (** table_description .dict ()))
76+
7377 for table in tables :
74- rows .append (
75- repository .save_table_info (
76- TableDescription (
77- db_connection_id = db_connection_id ,
78- table_name = table ,
79- status = TableDescriptionStatus .NOT_SCANNED .value ,
80- metadata = metadata ,
78+ if table not in stored_tables_list :
79+ rows .append (
80+ repository .save_table_info (
81+ TableDescription (
82+ db_connection_id = db_connection_id ,
83+ table_name = table ,
84+ status = TableDescriptionStatus .NOT_SCANNED .value ,
85+ metadata = metadata ,
86+ )
8187 )
8288 )
83- )
8489 return rows
8590
8691 @override
You can’t perform that action at this time.
0 commit comments