Skip to content

Commit 9d3ac8c

Browse files
committed
Update the Pyarrow concat
1 parent 76a376b commit 9d3ac8c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/databricks/sql/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
13351335
):
13361336
self._fill_results_buffer()
13371337
partial_results = self.results.next_n_rows(n_remaining_rows)
1338-
results = pyarrow.concat_tables([results, partial_results])
1338+
results = pyarrow.concat_tables([results, partial_results],promote_options="default")
13391339
n_remaining_rows -= partial_results.num_rows
13401340
self._next_row_index += partial_results.num_rows
13411341

@@ -1391,7 +1391,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
13911391
while not self.has_been_closed_server_side and self.has_more_rows:
13921392
self._fill_results_buffer()
13931393
partial_results = self.results.remaining_rows()
1394-
results = pyarrow.concat_tables([results, partial_results])
1394+
results = pyarrow.concat_tables([results, partial_results],promote_options="default")
13951395
self._next_row_index += partial_results.num_rows
13961396

13971397
return results

src/databricks/sql/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def next_n_rows(self, num_rows: int) -> "pyarrow.Table":
265265
# Get remaining of num_rows or the rest of the current table, whichever is smaller
266266
length = min(num_rows, self.table.num_rows - self.table_row_index)
267267
table_slice = self.table.slice(self.table_row_index, length)
268-
results = pyarrow.concat_tables([results, table_slice])
268+
results = pyarrow.concat_tables([results, table_slice],promote_options="default")
269269
self.table_row_index += table_slice.num_rows
270270

271271
# Replace current table with the next table if we are at the end of the current table
@@ -292,7 +292,7 @@ def remaining_rows(self) -> "pyarrow.Table":
292292
table_slice = self.table.slice(
293293
self.table_row_index, self.table.num_rows - self.table_row_index
294294
)
295-
results = pyarrow.concat_tables([results, table_slice])
295+
results = pyarrow.concat_tables([results, table_slice],promote_options="default")
296296
self.table_row_index += table_slice.num_rows
297297
self.table = self._create_next_table()
298298
self.table_row_index = 0

tests/unit/test_cloud_fetch_queue.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_next_n_rows_more_than_one_table(self, mock_create_next_table):
185185
assert (
186186
result
187187
== pyarrow.concat_tables(
188-
[self.make_arrow_table(), self.make_arrow_table()]
188+
[self.make_arrow_table(), self.make_arrow_table()],promote_options="default"
189189
)[:7]
190190
)
191191

@@ -309,7 +309,7 @@ def test_remaining_rows_multiple_tables_fully_returned(
309309
assert (
310310
result
311311
== pyarrow.concat_tables(
312-
[self.make_arrow_table(), self.make_arrow_table()]
312+
[self.make_arrow_table(), self.make_arrow_table()],promote_options="default"
313313
)[3:]
314314
)
315315

0 commit comments

Comments
 (0)