🐛 Bug: index_parquet_dataset() fails with TypeError when passing storage_options for S3
ld.index_parquet_dataset() fails with TypeError: filesystem() takes 1 positional argument but 4 were given when passing storage_options for S3. The bug is in litdata/utilities/parquet.py — it unpacks storage_options as positional arguments instead of keyword arguments.
To Reproduce
Steps to reproduce the behavior:
- Install
litdata==0.2.61
- Call
ld.index_parquet_dataset() with an S3 path and a storage_options dict
Code sample
import litdata as ld
pq_dataset_uri = 's3://bucket/path/to/parquet/'
ld.index_parquet_dataset(
pq_dataset_uri,
storage_options={
"key": "ACCESS_KEY",
"secret": "SECRET_KEY",
"endpoint_url": "https://s3.example.com",
},
)
Error:
TypeError: filesystem() takes 1 positional argument but 4 were given
Stack trace excerpt:
File ~/.local/lib/python3.11/site-packages/litdata/utilities/parquet.py:150, in filesystem()
150 self.fs = fsspec.filesystem(provider, *self.storage_options)
Root Cause
The bug is in litdata/utilities/parquet.py line ~150:
# BUG: unpacks dict keys as positional args
self.fs = fsspec.filesystem(provider, *self.storage_options)
Should be:
# FIX: pass as keyword arguments
self.fs = fsspec.filesystem(provider, **self.storage_options)
Expected behavior
The function should pass storage_options as keyword arguments to fsspec.filesystem(), allowing S3 and other remote filesystems to be initialized correctly.
Additional context
This bug affects all users trying to use index_parquet_dataset() with S3 or any filesystem requiring authentication options.
Environment detail
- litdata version: 0.2.61
- Python version: 3.11
- OS: Linux
- Storage: S3-compatible (any provider)
🐛 Bug:
index_parquet_dataset()fails withTypeErrorwhen passingstorage_optionsfor S3ld.index_parquet_dataset()fails withTypeError: filesystem() takes 1 positional argument but 4 were givenwhen passingstorage_optionsfor S3. The bug is inlitdata/utilities/parquet.py— it unpacksstorage_optionsas positional arguments instead of keyword arguments.To Reproduce
Steps to reproduce the behavior:
litdata==0.2.61ld.index_parquet_dataset()with an S3 path and astorage_optionsdictCode sample
Error:
Stack trace excerpt:
Root Cause
The bug is in
litdata/utilities/parquet.pyline ~150:Should be:
Expected behavior
The function should pass
storage_optionsas keyword arguments tofsspec.filesystem(), allowing S3 and other remote filesystems to be initialized correctly.Additional context
This bug affects all users trying to use
index_parquet_dataset()with S3 or any filesystem requiring authentication options.Environment detail