File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/databricks/sql/backend Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,28 @@ def __init__(
235235 self .has_result_set = has_result_set
236236 self .modified_row_count = modified_row_count
237237
238+ def __str__ (self ) -> str :
239+ """
240+ Return a string representation of the CommandId.
241+
242+ For SEA backend, returns the guid.
243+ For Thrift backend, returns a format like "guid|secret".
244+
245+ Returns:
246+ A string representation of the command ID
247+ """
248+
249+ if self .backend_type == BackendType .SEA :
250+ return str (self .guid )
251+ elif self .backend_type == BackendType .THRIFT :
252+ secret_hex = (
253+ guid_to_hex_id (self .secret )
254+ if isinstance (self .secret , bytes )
255+ else str (self .secret )
256+ )
257+ return f"{ self .to_hex_guid ()} |{ secret_hex } "
258+ return str (self .guid )
259+
238260 @classmethod
239261 def from_thrift_handle (cls , operation_handle ):
240262 """
You can’t perform that action at this time.
0 commit comments