From f26c340cacf7ea0a4de39b24fc2b3345606d461d Mon Sep 17 00:00:00 2001 From: alexander-beedie Date: Sat, 6 Apr 2024 11:54:43 +0400 Subject: [PATCH] fix(python): address issue with `read_database` draining iter_batches eagerly --- py-polars/polars/io/database/_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-polars/polars/io/database/_executor.py b/py-polars/polars/io/database/_executor.py index 5249f7d0ddfe..f8c22d49d8e0 100644 --- a/py-polars/polars/io/database/_executor.py +++ b/py-polars/polars/io/database/_executor.py @@ -276,7 +276,7 @@ def _from_rows( orient="row", ) for rows in ( - list(self._fetchmany_rows(self.result, batch_size)) + self._fetchmany_rows(self.result, batch_size) if iter_batches else [self._fetchall_rows(self.result)] # type: ignore[list-item] )