Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
  • Loading branch information
susodapop committed Jul 8, 2023
1 parent 758bb6b commit 7aff3a9
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/databricks/sql/thrift_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,15 +526,17 @@ def _check_command_not_in_error_or_closed_state(
raise ServerOperationError(
get_operations_resp.displayMessage,
{
"operation-id": op_handle and self.guid_to_hex_id(op_handle.operationId.guid),
"operation-id": op_handle
and self.guid_to_hex_id(op_handle.operationId.guid),
"diagnostic-info": get_operations_resp.diagnosticInfo,
},
)
else:
raise ServerOperationError(
get_operations_resp.errorMessage,
{
"operation-id": op_handle and self.guid_to_hex_id(op_handle.operationId.guid),
"operation-id": op_handle
and self.guid_to_hex_id(op_handle.operationId.guid),
"diagnostic-info": None,
},
)
Expand All @@ -543,7 +545,10 @@ def _check_command_not_in_error_or_closed_state(
"Command {} unexpectedly closed server side".format(
op_handle and self.guid_to_hex_id(op_handle.operationId.guid)
),
{"operation-id": op_handle and self.guid_to_hex_id(op_handle.operationId.guid)},
{
"operation-id": op_handle
and self.guid_to_hex_id(op_handle.operationId.guid)
},
)

def _poll_for_status(self, op_handle):
Expand Down Expand Up @@ -1015,7 +1020,11 @@ def close_command(self, op_handle):
return resp.status

def cancel_command(self, active_op_handle):
logger.debug("Cancelling command {}".format(self.guid_to_hex_id(active_op_handle.operationId.guid)))
logger.debug(
"Cancelling command {}".format(
self.guid_to_hex_id(active_op_handle.operationId.guid)
)
)
req = ttypes.TCancelOperationReq(active_op_handle)
self.make_request(self._client.CancelOperation, req)

Expand All @@ -1027,7 +1036,7 @@ def handle_to_id(session_handle):
def handle_to_hex_id(session_handle: TCLIService.TSessionHandle):
this_uuid = uuid.UUID(bytes=session_handle.sessionId.guid)
return str(this_uuid)

@staticmethod
def guid_to_hex_id(guid: bytes) -> str:
"""Return a hexadecimal string instead of bytes
Expand Down

0 comments on commit 7aff3a9

Please sign in to comment.