File tree Expand file tree Collapse file tree 2 files changed +17
-14
lines changed
Expand file tree Collapse file tree 2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,22 @@ def to_hex_id(self) -> str:
127127 else :
128128 return str (self .guid )
129129
130+ def get_protocol_version (self ):
131+ """
132+ Since the sessionHandle will sometimes have a serverProtocolVersion, it takes
133+ precedence over the serverProtocolVersion defined in the OpenSessionResponse.
134+ """
135+ if self .backend_type != BackendType .THRIFT :
136+ return None
137+ session_handle = self .to_thrift_handle ()
138+ if (
139+ session_handle
140+ and hasattr (session_handle , "serverProtocolVersion" )
141+ and session_handle .serverProtocolVersion
142+ ):
143+ return session_handle .serverProtocolVersion
144+ return None
145+
130146
131147class CommandId :
132148 """
Original file line number Diff line number Diff line change @@ -96,20 +96,7 @@ def open(self):
9696
9797 @staticmethod
9898 def get_protocol_version (session_id : SessionId ):
99- """
100- Since the sessionHandle will sometimes have a serverProtocolVersion, it takes
101- precedence over the serverProtocolVersion defined in the OpenSessionResponse.
102- """
103- if session_id .backend_type != BackendType .THRIFT :
104- return None
105- session_handle = session_id .to_thrift_handle ()
106- if (
107- session_handle
108- and hasattr (session_handle , "serverProtocolVersion" )
109- and session_handle .serverProtocolVersion
110- ):
111- return session_handle .serverProtocolVersion
112- return None
99+ return session_id .get_protocol_version ()
113100
114101 @staticmethod
115102 def server_parameterized_queries_enabled (protocolVersion ):
You can’t perform that action at this time.
0 commit comments