@@ -474,19 +474,39 @@ def __init__(
474474 result_data: Result data from SEA response (optional)
475475 manifest: Manifest from SEA response (optional)
476476 """
477+ # Extract and store SEA-specific properties
478+ self .statement_id = (
479+ execute_response .command_id .to_sea_statement_id ()
480+ if execute_response .command_id
481+ else None
482+ )
483+
484+ # Build the results queue
485+ results_queue = None
477486
478487 if result_data :
479- queue = SeaResultSetQueueFactory .build_queue (
480- sea_result_data = result_data ,
481- manifest = manifest ,
482- statement_id = execute_response .command_id .to_sea_statement_id (),
483- description = execute_response .description ,
484- schema_bytes = execute_response .arrow_schema_bytes ,
488+ from typing import cast , List
489+
490+ # Convert description to the expected format
491+ desc = None
492+ if execute_response .description :
493+ desc = cast (List [Tuple [Any , ...]], execute_response .description )
494+
495+ results_queue = SeaResultSetQueueFactory .build_queue (
496+ result_data ,
497+ manifest ,
498+ str (self .statement_id ),
499+ description = desc ,
500+ schema_bytes = execute_response .arrow_schema_bytes
501+ if execute_response .arrow_schema_bytes
502+ else None ,
503+ max_download_threads = sea_client .max_download_threads ,
504+ ssl_options = sea_client .ssl_options ,
505+ sea_client = sea_client ,
506+ lz4_compressed = execute_response .lz4_compressed ,
485507 )
486- else :
487- logger .warning ("No result data provided for SEA result set" )
488- queue = JsonQueue ([])
489508
509+ # Call parent constructor with common attributes
490510 super ().__init__ (
491511 connection = connection ,
492512 backend = sea_client ,
@@ -495,13 +515,15 @@ def __init__(
495515 command_id = execute_response .command_id ,
496516 status = execute_response .status ,
497517 has_been_closed_server_side = execute_response .has_been_closed_server_side ,
498- results_queue = queue ,
499518 description = execute_response .description ,
500519 is_staging_operation = execute_response .is_staging_operation ,
501520 lz4_compressed = execute_response .lz4_compressed ,
502- arrow_schema_bytes = execute_response .arrow_schema_bytes ,
521+ arrow_schema_bytes = execute_response .arrow_schema_bytes or b"" ,
503522 )
504523
524+ # Initialize queue for result data if not provided
525+ self .results = results_queue or JsonQueue ([])
526+
505527 def _convert_to_row_objects (self , rows ):
506528 """
507529 Convert raw data rows to Row objects with named columns based on description.
0 commit comments