@@ -61,22 +61,23 @@ def _connected_catalog(self) -> t.Optional[str]:
6161 def _connected_catalog (self , value : t .Optional [str ]) -> None :
6262 self ._connection_pool .set_attribute ("connected_catalog" , value )
6363
64- def _normalize_catalog (
65- self , catalog_name : t .Optional [str ]
66- ) -> t .Optional [str ]:
64+ def _normalize_catalog (self , catalog_name : t .Optional [str ]) -> t .Optional [str ]:
6765 if not catalog_name :
6866 return None
6967
70- default_catalog = (
71- self ._default_catalog or self ._extra_config .get ("database" )
72- )
68+ default_catalog = self ._default_catalog or self ._extra_config .get ("database" )
7369 if default_catalog and catalog_name == default_catalog :
7470 return None
7571
7672 return catalog_name
7773
7874 def _catalog_state_label (self , catalog_name : t .Optional [str ]) -> str :
79- return catalog_name or self ._default_catalog or self ._extra_config .get ("database" ) or "<default>"
75+ return (
76+ catalog_name
77+ or self ._default_catalog
78+ or self ._extra_config .get ("database" )
79+ or "<default>"
80+ )
8081
8182 @property
8283 def api_client (self ) -> FabricHttpClient :
@@ -166,9 +167,7 @@ def set_current_catalog(self, catalog_name: t.Optional[str]) -> None:
166167
167168 # No-op: the logical catalog state already matches.
168169 if self .get_current_catalog () == target_catalog :
169- logger .debug (
170- "Already using requested Fabric catalog state, no action needed"
171- )
170+ logger .debug ("Already using requested Fabric catalog state, no action needed" )
172171 return
173172
174173 # Decide whether the open connection needs to be replaced.
@@ -188,9 +187,7 @@ def set_current_catalog(self, catalog_name: t.Optional[str]) -> None:
188187 # restore-to-neutral left the connection on the right catalog, we
189188 # skip the close entirely.
190189 connected_catalog = self ._normalize_catalog (self ._connected_catalog )
191- needs_reconnect = (
192- target_catalog is not None and connected_catalog != target_catalog
193- )
190+ needs_reconnect = target_catalog is not None and connected_catalog != target_catalog
194191
195192 if needs_reconnect :
196193 logger .info (
0 commit comments