@@ -67,22 +67,23 @@ def _connected_catalog(self) -> t.Optional[str]:
6767 def _connected_catalog (self , value : t .Optional [str ]) -> None :
6868 self ._connection_pool .set_attribute ("connected_catalog" , value )
6969
70- def _normalize_catalog (
71- self , catalog_name : t .Optional [str ]
72- ) -> t .Optional [str ]:
70+ def _normalize_catalog (self , catalog_name : t .Optional [str ]) -> t .Optional [str ]:
7371 if not catalog_name :
7472 return None
7573
76- default_catalog = (
77- self ._default_catalog or self ._extra_config .get ("database" )
78- )
74+ default_catalog = self ._default_catalog or self ._extra_config .get ("database" )
7975 if default_catalog and catalog_name == default_catalog :
8076 return None
8177
8278 return catalog_name
8379
8480 def _catalog_state_label (self , catalog_name : t .Optional [str ]) -> str :
85- return catalog_name or self ._default_catalog or self ._extra_config .get ("database" ) or "<default>"
81+ return (
82+ catalog_name
83+ or self ._default_catalog
84+ or self ._extra_config .get ("database" )
85+ or "<default>"
86+ )
8687
8788 @property
8889 def api_client (self ) -> FabricHttpClient :
@@ -172,9 +173,7 @@ def set_current_catalog(self, catalog_name: t.Optional[str]) -> None:
172173
173174 # No-op: the logical catalog state already matches.
174175 if self .get_current_catalog () == target_catalog :
175- logger .debug (
176- "Already using requested Fabric catalog state, no action needed"
177- )
176+ logger .debug ("Already using requested Fabric catalog state, no action needed" )
178177 return
179178
180179 # Decide whether the open connection needs to be replaced.
@@ -194,9 +193,7 @@ def set_current_catalog(self, catalog_name: t.Optional[str]) -> None:
194193 # restore-to-neutral left the connection on the right catalog, we
195194 # skip the close entirely.
196195 connected_catalog = self ._normalize_catalog (self ._connected_catalog )
197- needs_reconnect = (
198- target_catalog is not None and connected_catalog != target_catalog
199- )
196+ needs_reconnect = target_catalog is not None and connected_catalog != target_catalog
200197
201198 if needs_reconnect :
202199 logger .info (
0 commit comments