Skip to content

Commit ddc2940

Browse files
committed
eff conv
1 parent f599ebc commit ddc2940

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/databricks/sql/client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,14 +1403,13 @@ def _convert_columnar_table(self, table):
14031403

14041404
return result
14051405

1406-
def _convert_arrow_table(self, table):
1406+
def _convert_arrow_table(self, table: "pyarrow.Table"):
14071407
column_names = [c[0] for c in self.description]
14081408
ResultRow = Row(*column_names)
14091409

14101410
if self.connection.disable_pandas is True:
1411-
return [
1412-
ResultRow(*[v.as_py() for v in r]) for r in zip(*table.itercolumns())
1413-
]
1411+
columns_as_lists = [col.to_pylist() for col in table.itercolumns()]
1412+
return [ResultRow(*row) for row in zip(*columns_as_lists)]
14141413

14151414
# Need to use nullable types, as otherwise type can change when there are missing values.
14161415
# See https://arrow.apache.org/docs/python/pandas.html#nullable-types

0 commit comments

Comments
 (0)