Skip to content

Commit 91357f4

Browse files
get_id -> get_guid
Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent 54077f7 commit 91357f4

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/databricks/sql/backend/types.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def __str__(self) -> str:
6363
if isinstance(self.secret, bytes)
6464
else str(self.secret)
6565
)
66-
return f"{self.get_hex_id()}|{secret_hex}"
66+
return f"{self.get_hex_guid()}|{secret_hex}"
6767
return str(self.guid)
6868

6969
@classmethod
@@ -137,13 +137,13 @@ def to_sea_session_id(self):
137137

138138
return self.guid
139139

140-
def get_id(self) -> Any:
140+
def get_guid(self) -> Any:
141141
"""
142142
Get the ID of the session.
143143
"""
144144
return self.guid
145145

146-
def get_hex_id(self) -> str:
146+
def get_hex_guid(self) -> str:
147147
"""
148148
Get a hexadecimal string representation of the session ID.
149149
@@ -214,7 +214,12 @@ def __str__(self) -> str:
214214
if self.backend_type == BackendType.SEA:
215215
return str(self.guid)
216216
elif self.backend_type == BackendType.THRIFT:
217-
return f"{self.to_hex_id()}|{guid_to_hex_id(self.secret) if isinstance(self.secret, bytes) else str(self.secret)}"
217+
secret_hex = (
218+
guid_to_hex_id(self.secret)
219+
if isinstance(self.secret, bytes)
220+
else str(self.secret)
221+
)
222+
return f"{self.to_hex_guid()}|{secret_hex}"
218223
return str(self.guid)
219224

220225
@classmethod
@@ -288,7 +293,7 @@ def to_sea_statement_id(self):
288293

289294
return self.guid
290295

291-
def to_hex_id(self) -> str:
296+
def to_hex_guid(self) -> str:
292297
"""
293298
Get a hexadecimal string representation of the command ID.
294299

src/databricks/sql/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,11 @@ def get_session_id(self) -> SessionId:
116116

117117
def get_id(self):
118118
"""Get the raw session ID (backend-specific)"""
119-
return self._session_id.get_id()
119+
return self._session_id.get_guid()
120120

121121
def get_id_hex(self) -> str:
122122
"""Get the session ID in hex format"""
123-
return self._session_id.get_hex_id()
123+
return self._session_id.get_hex_guid()
124124

125125
def close(self) -> None:
126126
"""Close the underlying session."""

0 commit comments

Comments
 (0)