Skip to content

Commit fb0fa46

Browse files
use connection open property instead of long chain through session
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 03d3ae7 commit fb0fa46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/databricks/sql/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def __exit__(self, exc_type, exc_value, traceback):
308308
return False
309309

310310
def __del__(self):
311-
if self.session.open:
311+
if self.open:
312312
logger.debug(
313313
"Closing unclosed connection for session "
314314
"{}".format(self.get_session_id_hex())
@@ -357,7 +357,7 @@ def cursor(
357357
358358
Will throw an Error if the connection has been closed.
359359
"""
360-
if not self.session.open:
360+
if not self.open:
361361
raise Error("Cannot create cursor from closed connection")
362362

363363
cursor = Cursor(

0 commit comments

Comments
 (0)