@@ -282,6 +282,43 @@ def get_allowed_session_configurations() -> List[str]:
282
282
"""
283
283
return list (ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP .keys ())
284
284
285
+ def _extract_description_from_manifest (self , manifest_obj ) -> Optional [List ]:
286
+ """
287
+ Extract column description from a manifest object.
288
+
289
+ Args:
290
+ manifest_obj: The ResultManifest object containing schema information
291
+
292
+ Returns:
293
+ Optional[List]: A list of column tuples or None if no columns are found
294
+ """
295
+
296
+ schema_data = manifest_obj .schema
297
+ columns_data = schema_data .get ("columns" , [])
298
+
299
+ if not columns_data :
300
+ return None
301
+
302
+ columns = []
303
+ for col_data in columns_data :
304
+ if not isinstance (col_data , dict ):
305
+ continue
306
+
307
+ # Format: (name, type_code, display_size, internal_size, precision, scale, null_ok)
308
+ columns .append (
309
+ (
310
+ col_data .get ("name" , "" ), # name
311
+ col_data .get ("type_name" , "" ), # type_code
312
+ None , # display_size (not provided by SEA)
313
+ None , # internal_size (not provided by SEA)
314
+ col_data .get ("precision" ), # precision
315
+ col_data .get ("scale" ), # scale
316
+ col_data .get ("nullable" , True ), # null_ok
317
+ )
318
+ )
319
+
320
+ return columns if columns else None
321
+
285
322
def _results_message_to_execute_response (self , sea_response , command_id ):
286
323
"""
287
324
Convert a SEA response to an ExecuteResponse and extract result data.
@@ -301,28 +338,7 @@ def _results_message_to_execute_response(self, sea_response, command_id):
301
338
result_data_obj = parse_result (sea_response )
302
339
303
340
# Extract description from manifest schema
304
- description = None
305
- schema_data = manifest_obj .schema
306
- columns_data = schema_data .get ("columns" , [])
307
- if columns_data :
308
- columns = []
309
- for col_data in columns_data :
310
- if not isinstance (col_data , dict ):
311
- continue
312
-
313
- # Format: (name, type_code, display_size, internal_size, precision, scale, null_ok)
314
- columns .append (
315
- (
316
- col_data .get ("name" , "" ), # name
317
- col_data .get ("type_name" , "" ), # type_code
318
- None , # display_size (not provided by SEA)
319
- None , # internal_size (not provided by SEA)
320
- col_data .get ("precision" ), # precision
321
- col_data .get ("scale" ), # scale
322
- col_data .get ("nullable" , True ), # null_ok
323
- )
324
- )
325
- description = columns if columns else None
341
+ description = self ._extract_description_from_manifest (manifest_obj )
326
342
327
343
# Check for compression
328
344
lz4_compressed = manifest_obj .result_compression == "LZ4_FRAME"
0 commit comments