@@ -335,8 +335,15 @@ def get_session_id(self):
335335 @staticmethod
336336 def get_protocol_version (openSessionResp ):
337337 """
338- Return the serverProtocolVersion from the OpenSessionResponse.
338+ Since the sessionHandle will sometimes have a serverProtocolVersion, it takes
339+ precedence over the serverProtocolVersion defined in the OpenSessionResponse.
339340 """
341+ if (
342+ openSessionResp .sessionHandle
343+ and hasattr (openSessionResp .sessionHandle , "serverProtocolVersion" )
344+ and openSessionResp .sessionHandle .serverProtocolVersion
345+ ):
346+ return openSessionResp .sessionHandle .serverProtocolVersion
340347 return openSessionResp .serverProtocolVersion
341348
342349 @staticmethod
@@ -747,6 +754,7 @@ def execute(
747754 self ,
748755 operation : str ,
749756 parameters : Optional [TParameterCollection ] = None ,
757+ enforce_embedded_schema_correctness = False ,
750758 ) -> "Cursor" :
751759 """
752760 Execute a query and wait for execution to complete.
@@ -811,6 +819,7 @@ def execute(
811819 use_cloud_fetch = self .connection .use_cloud_fetch ,
812820 parameters = prepared_params ,
813821 async_op = False ,
822+ enforce_embedded_schema_correctness = enforce_embedded_schema_correctness ,
814823 )
815824 self .active_result_set = ResultSet (
816825 self .connection ,
@@ -832,6 +841,7 @@ def execute_async(
832841 self ,
833842 operation : str ,
834843 parameters : Optional [TParameterCollection ] = None ,
844+ enforce_embedded_schema_correctness = False ,
835845 ) -> "Cursor" :
836846 """
837847
@@ -872,6 +882,7 @@ def execute_async(
872882 use_cloud_fetch = self .connection .use_cloud_fetch ,
873883 parameters = prepared_params ,
874884 async_op = True ,
885+ enforce_embedded_schema_correctness = enforce_embedded_schema_correctness ,
875886 )
876887
877888 return self
0 commit comments