Skip to content

Commit 03cdc4f

Browse files
re-introduce accidentally removed description extraction method
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent ac50669 commit 03cdc4f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/databricks/sql/backend/sea/backend.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,43 @@ def get_allowed_session_configurations() -> List[str]:
289289
"""
290290
return list(ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP.keys())
291291

292+
def _extract_description_from_manifest(self, manifest_obj) -> Optional[List]:
293+
"""
294+
Extract column description from a manifest object.
295+
296+
Args:
297+
manifest_obj: The ResultManifest object containing schema information
298+
299+
Returns:
300+
Optional[List]: A list of column tuples or None if no columns are found
301+
"""
302+
303+
schema_data = manifest_obj.schema
304+
columns_data = schema_data.get("columns", [])
305+
306+
if not columns_data:
307+
return None
308+
309+
columns = []
310+
for col_data in columns_data:
311+
if not isinstance(col_data, dict):
312+
continue
313+
314+
# Format: (name, type_code, display_size, internal_size, precision, scale, null_ok)
315+
columns.append(
316+
(
317+
col_data.get("name", ""), # name
318+
col_data.get("type_name", ""), # type_code
319+
None, # display_size (not provided by SEA)
320+
None, # internal_size (not provided by SEA)
321+
col_data.get("precision"), # precision
322+
col_data.get("scale"), # scale
323+
col_data.get("nullable", True), # null_ok
324+
)
325+
)
326+
327+
return columns if columns else None
328+
292329
def get_chunk_link(self, statement_id: str, chunk_index: int) -> "ExternalLink":
293330
"""
294331
Get links for chunks starting from the specified index.

0 commit comments

Comments
 (0)