Skip to content

Commit b45871e

Browse files
add open property to Connection to ensure maintenance of existing API
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 1b0fc9b commit b45871e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/databricks/sql/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ def get_protocol_version(openSessionResp):
346346
@property
347347
def open(self) -> bool:
348348
"""Return whether the connection is open by checking if the session is open."""
349-
# NOTE: we have to check for the existence of session in case the __del__ is called
350-
# before the session is instantiated
351-
return hasattr(self, "session") and self.session.open
349+
return self.session.open
352350

353351
def cursor(
354352
self,

0 commit comments

Comments
 (0)