From 113e790f08baf4b1094a98c52c24d8be816f8e3f Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 15 Dec 2023 04:57:44 +0100 Subject: [PATCH] try fix --- py-polars/polars/io/parquet/functions.py | 5 +++-- py-polars/polars/lazyframe/frame.py | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/py-polars/polars/io/parquet/functions.py b/py-polars/polars/io/parquet/functions.py index ca71d7e55223..61e1e492e602 100644 --- a/py-polars/polars/io/parquet/functions.py +++ b/py-polars/polars/io/parquet/functions.py @@ -106,8 +106,6 @@ def read_parquet( benchmarking the parquet-reader as `rechunk` can be an expensive operation that should not contribute to the timings. """ - storage_options = storage_options or {} - if use_pyarrow: if not _PYARROW_AVAILABLE: raise ModuleNotFoundError( @@ -120,6 +118,7 @@ def read_parquet( import pyarrow.parquet pyarrow_options = pyarrow_options or {} + storage_options = storage_options or {} # TODO: Update _prepare_file_arg to handle list[Path] input with _prepare_file_arg( @@ -137,6 +136,8 @@ def read_parquet( ) if isinstance(source, (BinaryIO, BytesIO, bytes)): + storage_options = storage_options or {} + with _prepare_file_arg( source, use_pyarrow=use_pyarrow, **storage_options ) as source_prep: diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index 7e5443be62ff..915a4a6d0f1b 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -450,6 +450,9 @@ def _scan_parquet( if storage_options is not None: storage_options = list(storage_options.items()) # type: ignore[assignment] + print(source) + print(storage_options) + self = cls.__new__(cls) self._ldf = PyLazyFrame.new_from_parquet( source,