Skip to content

Commit cac7a53

Browse files
revert to old result set
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent 0615c40 commit cac7a53

File tree

2 files changed

+110
-233
lines changed

2 files changed

+110
-233
lines changed

src/databricks/sql/result_set.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,21 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
508508
n_remaining_rows = size - results.num_rows
509509
self._next_row_index += results.num_rows
510510

511+
def _convert_json_table(self, rows):
512+
"""
513+
Convert raw data rows to Row objects with named columns based on description.
514+
Args:
515+
rows: List of raw data rows
516+
Returns:
517+
List of Row objects with named columns
518+
"""
519+
if not self.description or not rows:
520+
return rows
521+
522+
column_names = [col[0] for col in self.description]
523+
ResultRow = Row(*column_names)
524+
return [ResultRow(*row) for row in rows]
525+
511526
def fetchmany_json(self, size: int):
512527
"""
513528
Fetch the next set of rows as a columnar table.

0 commit comments

Comments
 (0)