Skip to content

Commit 245aa77

Browse files
stronger typing for fetch*_json
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 28b4d7b commit 245aa77

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/databricks/sql/result_set.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def __init__(
505505
arrow_schema_bytes=execute_response.arrow_schema_bytes or b"",
506506
)
507507

508-
def _convert_json_to_arrow(self, rows: List) -> "pyarrow.Table":
508+
def _convert_json_to_arrow(self, rows: List[List]) -> "pyarrow.Table":
509509
"""
510510
Convert raw data rows to Arrow table.
511511
"""
@@ -519,7 +519,7 @@ def _convert_json_to_arrow(self, rows: List) -> "pyarrow.Table":
519519
names = [col[0] for col in self.description]
520520
return pyarrow.Table.from_arrays(columns, names=names)
521521

522-
def _convert_json_types(self, rows: List) -> List:
522+
def _convert_json_types(self, rows: List[List]) -> List[List]:
523523
"""
524524
Convert raw data rows to Row objects with named columns based on description.
525525
Also converts string values to appropriate Python types based on column metadata.
@@ -554,7 +554,7 @@ def _convert_json_types(self, rows: List) -> List:
554554

555555
return converted_rows
556556

557-
def _create_json_table(self, rows: List) -> List[Row]:
557+
def _create_json_table(self, rows: List[List]) -> List[Row]:
558558
"""
559559
Convert raw data rows to Row objects with named columns based on description.
560560
Also converts string values to appropriate Python types based on column metadata.
@@ -573,7 +573,7 @@ def _create_json_table(self, rows: List) -> List[Row]:
573573

574574
return [ResultRow(*row) for row in rows]
575575

576-
def fetchmany_json(self, size: int) -> List:
576+
def fetchmany_json(self, size: int) -> List[List]:
577577
"""
578578
Fetch the next set of rows as a columnar table.
579579
@@ -595,7 +595,7 @@ def fetchmany_json(self, size: int) -> List:
595595

596596
return results
597597

598-
def fetchall_json(self) -> List:
598+
def fetchall_json(self) -> List[List]:
599599
"""
600600
Fetch all remaining rows as a columnar table.
601601

0 commit comments

Comments
 (0)