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

Commit48746d1

Browse files
authored
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>
1 parentedfb283 commit48746d1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

‎src/databricks/sql/client.py‎

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

217+
logger.debug(
218+
"Connection.__init__(server_hostname=%s, http_path=%s)",
219+
server_hostname,
220+
http_path,
221+
)
222+
217223
ifaccess_token:
218224
access_token_kv= {"access_token":access_token}
219225
kwargs= {**kwargs,**access_token_kv}
@@ -800,6 +806,9 @@ def execute(
800806
801807
:returns self
802808
"""
809+
logger.debug(
810+
"Cursor.execute(operation=%s, parameters=%s)",operation,parameters
811+
)
803812

804813
param_approach=self._determine_parameter_approach(parameters)
805814
ifparam_approach==ParameterApproach.NONE:

‎src/databricks/sql/thrift_backend.py‎

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

134+
logger.debug(
135+
"ThriftBackend.__init__(server_hostname=%s, port=%s, http_path=%s)",
136+
server_hostname,
137+
port,
138+
http_path,
139+
)
140+
134141
port=portor443
135142
ifkwargs.get("_connection_uri"):
136143
uri=kwargs.get("_connection_uri")
@@ -390,6 +397,8 @@ def attempt_request(attempt):
390397

391398
# TODO: don't use exception handling for GOS polling...
392399

400+
logger.error("ThriftBackend.attempt_request: HTTPError: %s",err)
401+
393402
gos_name=TCLIServiceClient.GetOperationStatus.__name__
394403
ifmethod.__name__==gos_name:
395404
delay_default= (
@@ -434,6 +443,7 @@ def attempt_request(attempt):
434443
else:
435444
logger.warning(log_string)
436445
exceptExceptionaserr:
446+
logger.error("ThriftBackend.attempt_request: Exception: %s",err)
437447
error=err
438448
retry_delay=extract_retry_delay(attempt)
439449
error_message=ThriftBackend._extract_error_message_from_headers(
@@ -888,6 +898,12 @@ def execute_command(
888898
):
889899
assertsession_handleisnotNone
890900

901+
logger.debug(
902+
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
903+
operation,
904+
session_handle,
905+
)
906+
891907
spark_arrow_types=ttypes.TSparkArrowTypes(
892908
timestampAsArrow=self._use_arrow_native_timestamps,
893909
decimalAsArrow=self._use_arrow_native_decimals,
@@ -1074,6 +1090,7 @@ def fetch_results(
10741090
returnqueue,resp.hasMoreRows
10751091

10761092
defclose_command(self,op_handle):
1093+
logger.debug("ThriftBackend.close_command(op_handle=%s)",op_handle)
10771094
req=ttypes.TCloseOperationReq(operationHandle=op_handle)
10781095
resp=self.make_request(self._client.CloseOperation,req)
10791096
returnresp.status

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp