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:
127
127
else :
128
128
return str (self .guid )
129
129
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
+
130
146
131
147
class CommandId :
132
148
"""
Original file line number Diff line number Diff line change @@ -96,20 +96,7 @@ def open(self):
96
96
97
97
@staticmethod
98
98
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 ()
113
100
114
101
@staticmethod
115
102
def server_parameterized_queries_enabled (protocolVersion ):
You can’t perform that action at this time.
0 commit comments