@@ -471,9 +471,9 @@ def __init__(
471
471
manifest: Manifest from SEA response (optional)
472
472
"""
473
473
474
- results_queue = None
474
+ self . results = None
475
475
if result_data :
476
- results_queue = SeaResultSetQueueFactory .build_queue (
476
+ self . results = SeaResultSetQueueFactory .build_queue (
477
477
result_data ,
478
478
manifest ,
479
479
str (execute_response .command_id .to_sea_statement_id ()),
@@ -498,9 +498,6 @@ def __init__(
498
498
arrow_schema_bytes = execute_response .arrow_schema_bytes or b"" ,
499
499
)
500
500
501
- # Initialize queue for result data if not provided
502
- self .results = results_queue or JsonQueue ([])
503
-
504
501
def _convert_json_to_arrow (self , rows ):
505
502
"""
506
503
Convert raw data rows to Arrow table.
@@ -546,7 +543,7 @@ def _convert_json_types(self, rows):
546
543
547
544
return converted_rows
548
545
549
- def _convert_json_table (self , rows ):
546
+ def _create_json_table (self , rows ):
550
547
"""
551
548
Convert raw data rows to Row objects with named columns based on description.
552
549
Also converts string values to appropriate Python types based on column metadata.
@@ -645,7 +642,7 @@ def fetchone(self) -> Optional[Row]:
645
642
A single Row object or None if no more rows are available
646
643
"""
647
644
if isinstance (self .results , JsonQueue ):
648
- res = self ._convert_json_table (self .fetchmany_json (1 ))
645
+ res = self ._create_json_table (self .fetchmany_json (1 ))
649
646
else :
650
647
raise NotImplementedError ("fetchone only supported for JSON data" )
651
648
@@ -665,7 +662,7 @@ def fetchmany(self, size: int) -> List[Row]:
665
662
ValueError: If size is negative
666
663
"""
667
664
if isinstance (self .results , JsonQueue ):
668
- return self ._convert_json_table (self .fetchmany_json (size ))
665
+ return self ._create_json_table (self .fetchmany_json (size ))
669
666
else :
670
667
raise NotImplementedError ("fetchmany only supported for JSON data" )
671
668
@@ -677,6 +674,6 @@ def fetchall(self) -> List[Row]:
677
674
List of Row objects containing all remaining rows
678
675
"""
679
676
if isinstance (self .results , JsonQueue ):
680
- return self ._convert_json_table (self .fetchall_json ())
677
+ return self ._create_json_table (self .fetchall_json ())
681
678
else :
682
679
raise NotImplementedError ("fetchall only supported for JSON data" )
0 commit comments