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

Commit9092004

Browse files
saishreeeeevarun-edachali-dbx
authored andcommitted
PECOBLR-86 improve logging on python driver (#556)
* PECOBLR-86 Improve logging for debug levelSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>* PECOBLR-86 Improve logging for debug levelSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>* fixed formatSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>* used lazy loggingSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>* changed debug to error logsSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>* used lazy loggingSigned-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>---------Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent4148a2c commit9092004

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

‎src/databricks/sql/backend/thrift_backend.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ def __init__(
132132
# max_download_threads
133133
# Number of threads for handling cloud fetch downloads. Defaults to 10
134134

135+
logger.debug(
136+
"ThriftBackend.__init__(server_hostname=%s, port=%s, http_path=%s)",
137+
server_hostname,
138+
port,
139+
http_path,
140+
)
141+
135142
port=portor443
136143
ifkwargs.get("_connection_uri"):
137144
uri=kwargs.get("_connection_uri")
@@ -403,6 +410,8 @@ def attempt_request(attempt):
403410

404411
# TODO: don't use exception handling for GOS polling...
405412

413+
logger.error("ThriftBackend.attempt_request: HTTPError: %s",err)
414+
406415
gos_name=TCLIServiceClient.GetOperationStatus.__name__
407416
ifmethod.__name__==gos_name:
408417
delay_default= (
@@ -447,6 +456,7 @@ def attempt_request(attempt):
447456
else:
448457
logger.warning(log_string)
449458
exceptExceptionaserr:
459+
logger.error("ThriftBackend.attempt_request: Exception: %s",err)
450460
error=err
451461
retry_delay=extract_retry_delay(attempt)
452462
error_message= (
@@ -904,6 +914,12 @@ def execute_command(
904914
):
905915
assertsession_handleisnotNone
906916

917+
logger.debug(
918+
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
919+
operation,
920+
session_handle,
921+
)
922+
907923
spark_arrow_types=ttypes.TSparkArrowTypes(
908924
timestampAsArrow=self._use_arrow_native_timestamps,
909925
decimalAsArrow=self._use_arrow_native_decimals,
@@ -1090,6 +1106,7 @@ def fetch_results(
10901106
returnqueue,resp.hasMoreRows
10911107

10921108
defclose_command(self,op_handle):
1109+
logger.debug("ThriftBackend.close_command(op_handle=%s)",op_handle)
10931110
req=ttypes.TCloseOperationReq(operationHandle=op_handle)
10941111
resp=self.make_request(self._client.CloseOperation,req)
10951112
returnresp.status

‎src/databricks/sql/client.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ def read(self) -> Optional[OAuthToken]:
216216
# use_cloud_fetch
217217
# Enable use of cloud fetch to extract large query results in parallel via cloud storage
218218

219+
logger.debug(
220+
"Connection.__init__(server_hostname=%s, http_path=%s)",
221+
server_hostname,
222+
http_path,
223+
)
224+
219225
ifaccess_token:
220226
access_token_kv= {"access_token":access_token}
221227
kwargs= {**kwargs,**access_token_kv}
@@ -745,6 +751,9 @@ def execute(
745751
746752
:returns self
747753
"""
754+
logger.debug(
755+
"Cursor.execute(operation=%s, parameters=%s)",operation,parameters
756+
)
748757

749758
param_approach=self._determine_parameter_approach(parameters)
750759
ifparam_approach==ParameterApproach.NONE:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp