Skip to content

Commit 63360b3

Browse files
use command_id methods instead of explicit guid_to_hex_id conversion
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent e3dfd36 commit 63360b3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/databricks/sql/backend/thrift_backend.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@
33
import logging
44
import math
55
import time
6-
import uuid
76
import threading
8-
from typing import List, Optional, Union, Any, TYPE_CHECKING
7+
from typing import Union, TYPE_CHECKING
98

109
if TYPE_CHECKING:
1110
from databricks.sql.client import Cursor
12-
from databricks.sql.result_set import ResultSet, ThriftResultSet
11+
from databricks.sql.result_set import ResultSet
1312

14-
from databricks.sql.thrift_api.TCLIService.ttypes import TOperationState
1513
from databricks.sql.backend.types import (
1614
CommandState,
1715
SessionId,
1816
CommandId,
19-
BackendType,
2017
)
2118
from databricks.sql.backend.utils import guid_to_hex_id
2219

@@ -1233,7 +1230,7 @@ def cancel_command(self, command_id: CommandId) -> None:
12331230
if not thrift_handle:
12341231
raise ValueError("Not a valid Thrift command ID")
12351232

1236-
logger.debug("Cancelling command {}".format(guid_to_hex_id(command_id.guid)))
1233+
logger.debug("Cancelling command {}".format(command_id.to_hex_guid()))
12371234
req = ttypes.TCancelOperationReq(thrift_handle)
12381235
self.make_request(self._client.CancelOperation, req)
12391236

0 commit comments

Comments
 (0)