Skip to content

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Dec 15, 2023
1 parent 8facd84 commit 113e790
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py-polars/polars/io/parquet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 113e790

Please sign in to comment.