File tree 1 file changed +11
-13
lines changed
1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -224,20 +224,18 @@ def refresh_table_description(
224
224
try :
225
225
sql_database = SQLDatabase .get_sql_engine (db_connection , True )
226
226
tables = sql_database .get_tables_and_views ()
227
+
228
+ # Get tables and views and create missing table-descriptions as NOT_SCANNED and update DEPRECATED
229
+ scanner_repository = TableDescriptionRepository (self .storage )
230
+ scanner = self .system .instance (Scanner )
231
+ return [
232
+ TableDescriptionResponse (** record .dict ())
233
+ for record in scanner .refresh_tables (
234
+ tables , str (db_connection .id ), scanner_repository
235
+ )
236
+ ]
227
237
except Exception as e :
228
- raise HTTPException ( # noqa: B904
229
- status_code = 400 ,
230
- detail = f"{ e } " ,
231
- )
232
- # Get tables and views and create missing table-descriptions as NOT_SCANNED and update DEPRECATED
233
- scanner_repository = TableDescriptionRepository (self .storage )
234
- scanner = self .system .instance (Scanner )
235
- return [
236
- TableDescriptionResponse (** record .dict ())
237
- for record in scanner .refresh_tables (
238
- tables , str (db_connection .id ), scanner_repository
239
- )
240
- ]
238
+ return error_response (e , refresh_table_description .dict (), "refresh_failed" )
241
239
242
240
@override
243
241
def list_database_connections (self ) -> list [DatabaseConnectionResponse ]:
You can’t perform that action at this time.
0 commit comments