File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,7 @@ def read(self) -> Optional[OAuthToken]:
243
243
_use_arrow_native_complex_types ,
244
244
** kwargs ,
245
245
)
246
+ self .session .open ()
246
247
247
248
logger .info (
248
249
"Successfully opened connection with session "
@@ -343,9 +344,7 @@ def get_protocol_version(openSessionResp):
343
344
@property
344
345
def open (self ) -> bool :
345
346
"""Return whether the connection is open by checking if the session is open."""
346
- # NOTE: we have to check for the existence of session in case the __del__ is called
347
- # before the session is instantiated
348
- return hasattr (self , "session" ) and self .session .open
347
+ return self .session .is_open
349
348
350
349
def cursor (
351
350
self ,
Original file line number Diff line number Diff line change @@ -31,10 +31,14 @@ def __init__(
31
31
32
32
This class handles all session-related behavior and communication with the backend.
33
33
"""
34
- self .open = False
34
+ self .is_open = False
35
35
self .host = server_hostname
36
36
self .port = kwargs .get ("_port" , 443 )
37
37
38
+ self .session_configuration = session_configuration
39
+ self .catalog = catalog
40
+ self .schema = schema
41
+
38
42
auth_provider = get_python_sql_connector_auth_provider (
39
43
server_hostname , ** kwargs
40
44
)
@@ -151,4 +155,4 @@ def close(self) -> None:
151
155
except Exception as e :
152
156
logger .error (f"Attempt to close session raised a local exception: { e } " )
153
157
154
- self .open = False
158
+ self .is_open = False
You can’t perform that action at this time.
0 commit comments