Skip to content

Commit 8b9fa88

Browse files
committed
merge with main changes
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 3a13b65 commit 8b9fa88

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/databricks/sql/client.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,27 @@ def read(self) -> Optional[OAuthToken]:
252252
self.client_telemetry_enabled and self.server_telemetry_enabled
253253
)
254254

255-
self.session = Session(
256-
server_hostname,
257-
http_path,
258-
http_headers,
259-
session_configuration,
260-
catalog,
261-
schema,
262-
_use_arrow_native_complex_types,
263-
**kwargs,
264-
)
265-
self.session.open()
255+
try:
256+
self.session = Session(
257+
server_hostname,
258+
http_path,
259+
http_headers,
260+
session_configuration,
261+
catalog,
262+
schema,
263+
_use_arrow_native_complex_types,
264+
**kwargs,
265+
)
266+
self.session.open()
267+
except Exception as e:
268+
TelemetryClientFactory.connection_failure_log(
269+
error_name=e.__class__.__name__,
270+
error_message=str(e),
271+
host_url=server_hostname,
272+
http_path=http_path,
273+
port=self.session.port,
274+
)
275+
raise e
266276

267277
self.use_inline_params = self._set_use_inline_params_with_warning(
268278
kwargs.get("use_inline_params", False)

0 commit comments

Comments
 (0)