Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit241e934

Browse files
nithinkdbJesse
and
Jesse
authored
[PECO-1083] Updated thrift files and added check for protocol version (#229)
* Updated thrift files and added check for protocol versionSigned-off-by: nithinkdb <nithin.krishnamurthi@databricks.com>* Made error message more clearSigned-off-by: nithinkdb <nithin.krishnamurthi@databricks.com>* Changed name of fnSigned-off-by: nithinkdb <nithin.krishnamurthi@databricks.com>* Ran linterSigned-off-by: nithinkdb <nithin.krishnamurthi@databricks.com>* Update src/databricks/sql/client.pyCo-authored-by: Jesse <jwhitehouse@airpost.net>---------Signed-off-by: nithinkdb <nithin.krishnamurthi@databricks.com>Co-authored-by: Jesse <jwhitehouse@airpost.net>
1 parent7c72cf4 commit241e934

File tree

3 files changed

+3964
-324
lines changed

3 files changed

+3964
-324
lines changed

‎src/databricks/sql/client.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
importrequests
66
importjson
77
importos
8+
fromdatabricks.sql.thrift_api.TCLIServiceimportttypes
89

910
fromdatabricks.sqlimport__version__
1011
fromdatabricks.sqlimport*
@@ -225,6 +226,11 @@ def __del__(self):
225226
defget_session_id(self):
226227
returnself.thrift_backend.handle_to_id(self._session_handle)
227228

229+
defget_session_protocol_version(self):
230+
returnself.thrift_backend.extract_protocol_version_from_handle(
231+
self._session_handle
232+
)
233+
228234
defget_session_id_hex(self):
229235
returnself.thrift_backend.handle_to_hex_id(self._session_handle)
230236

@@ -501,6 +507,13 @@ def execute(
501507
"""
502508
ifparametersisNone:
503509
parameters= []
510+
elif (
511+
self.connection.get_session_protocol_version()
512+
<ttypes.TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V8
513+
):
514+
raiseError(
515+
"Parameterized operations are not supported by this server. DBR 14.1 is required."
516+
)
504517
else:
505518
parameters=named_parameters_to_tsparkparams(parameters)
506519

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp