Skip to content

Commit e7e2333

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

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
@@ -307,7 +307,7 @@ def __exit__(self, exc_type, exc_value, traceback):
307307
return False
308308

309309
def __del__(self):
310-
if self.session.open:
310+
if self.open:
311311
logger.debug(
312312
"Closing unclosed connection for session "
313313
"{}".format(self.get_session_id_hex())
@@ -356,7 +356,7 @@ def cursor(
356356
357357
Will throw an Error if the connection has been closed.
358358
"""
359-
if not self.session.open:
359+
if not self.open:
360360
raise Error("Cannot create cursor from closed connection")
361361

362362
cursor = Cursor(

0 commit comments

Comments
 (0)