File tree 1 file changed +3
-24
lines changed
1 file changed +3
-24
lines changed Original file line number Diff line number Diff line change @@ -316,35 +316,14 @@ def _active_catalog(self, name: str | None):
316
316
prev_catalog = self .current_catalog
317
317
prev_database = self .current_database
318
318
319
- v = self .compiler .v
320
- quoted = self .compiler .quoted
321
- dialect = self .dialect
322
-
323
- catalog_sql = sge .Use (
324
- kind = v .CATALOG , this = sg .to_identifier (name , quoted = quoted )
325
- ).sql (dialect )
326
319
catalog_api = self ._session .catalog
327
320
328
321
try :
329
- try :
330
- self .raw_sql (catalog_sql )
331
- except ParseException :
332
- catalog_api .setCurrentCatalog (name )
322
+ catalog_api .setCurrentCatalog (name )
333
323
yield
334
324
finally :
335
- catalog_sql = sge .Use (
336
- kind = v .CATALOG , this = sg .to_identifier (prev_catalog , quoted = quoted )
337
- ).sql (dialect )
338
- db_sql = sge .Use (
339
- kind = v .DATABASE , this = sg .to_identifier (prev_database , quoted = quoted )
340
- ).sql (dialect )
341
-
342
- try :
343
- self .raw_sql (catalog_sql )
344
- self .raw_sql (db_sql )
345
- except ParseException :
346
- catalog_api .setCurrentCatalog (prev_catalog )
347
- catalog_api .setCurrentDatabase (prev_database )
325
+ catalog_api .setCurrentCatalog (prev_catalog )
326
+ catalog_api .setCurrentDatabase (prev_database )
348
327
349
328
def list_catalogs (self , * , like : str | None = None ) -> list [str ]:
350
329
catalogs = [cat .name for cat in self ._session .catalog .listCatalogs ()]
You can’t perform that action at this time.
0 commit comments