@@ -515,6 +515,7 @@ def _convert_json_types(self, rows: List) -> List:
515
515
Convert raw data rows to Row objects with named columns based on description.
516
516
Also converts string values to appropriate Python types based on column metadata.
517
517
"""
518
+
518
519
if not self .description or not rows :
519
520
return rows
520
521
@@ -554,6 +555,7 @@ def _create_json_table(self, rows: List) -> List[Row]:
554
555
Returns:
555
556
List of Row objects with named columns and converted values
556
557
"""
558
+
557
559
if not self .description or not rows :
558
560
return rows
559
561
@@ -575,6 +577,7 @@ def fetchmany_json(self, size: int) -> List:
575
577
Raises:
576
578
ValueError: If size is negative
577
579
"""
580
+
578
581
if size < 0 :
579
582
raise ValueError (f"size argument for fetchmany is { size } but must be >= 0" )
580
583
@@ -590,6 +593,7 @@ def fetchall_json(self) -> List:
590
593
Returns:
591
594
Columnar table containing all remaining rows
592
595
"""
596
+
593
597
results = self .results .remaining_rows ()
594
598
self ._next_row_index += len (results )
595
599
@@ -609,6 +613,7 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
609
613
ImportError: If PyArrow is not installed
610
614
ValueError: If size is negative
611
615
"""
616
+
612
617
if size < 0 :
613
618
raise ValueError (f"size argument for fetchmany is { size } but must be >= 0" )
614
619
@@ -625,6 +630,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
625
630
"""
626
631
Fetch all remaining rows as an Arrow table.
627
632
"""
633
+
628
634
if not isinstance (self .results , JsonQueue ):
629
635
raise NotImplementedError ("fetchall_arrow only supported for JSON data" )
630
636
@@ -642,6 +648,7 @@ def fetchone(self) -> Optional[Row]:
642
648
Returns:
643
649
A single Row object or None if no more rows are available
644
650
"""
651
+
645
652
if isinstance (self .results , JsonQueue ):
646
653
res = self ._create_json_table (self .fetchmany_json (1 ))
647
654
else :
@@ -662,6 +669,7 @@ def fetchmany(self, size: int) -> List[Row]:
662
669
Raises:
663
670
ValueError: If size is negative
664
671
"""
672
+
665
673
if isinstance (self .results , JsonQueue ):
666
674
return self ._create_json_table (self .fetchmany_json (size ))
667
675
else :
@@ -674,6 +682,7 @@ def fetchall(self) -> List[Row]:
674
682
Returns:
675
683
List of Row objects containing all remaining rows
676
684
"""
685
+
677
686
if isinstance (self .results , JsonQueue ):
678
687
return self ._create_json_table (self .fetchall_json ())
679
688
else :
0 commit comments