fix: declare pandas as runtime dep of parquet extra#1774
Open
dsmedia wants to merge 1 commit intofrictionlessdata:mainfrom
Open
fix: declare pandas as runtime dep of parquet extra#1774dsmedia wants to merge 1 commit intofrictionlessdata:mainfrom
dsmedia wants to merge 1 commit intofrictionlessdata:mainfrom
Conversation
The ParquetParser unconditionally calls pyarrow.Table.to_pandas() and constructs a TableResource(data=df, format="pandas"), so pandas is required at runtime for any .parquet read. The `parquet` extra only declared pyarrow, so `pip install 'frictionless[parquet]'` in isolation raised ModuleNotFoundError: pandas on first read. Tests never caught this because the hatch default env installs frictionless[...,pandas,parquet,...] together, masking the gap. The proper regression guard is a dedicated CI job that installs only .[parquet] and runs the parquet tests in isolation — out of scope here. - pyproject.toml: add pandas>=1.0 to the parquet extra - CHANGELOG.md: note under [Unreleased]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1773.
Summary
frictionless[parquet]currently raisesModuleNotFoundError: No module named 'pandas'on the first.parquetread becauseParquetParseruses pandas unconditionally (to_pandas(),TableResource(format="pandas"),platform.pandas.io.common.get_handle) but theparquetextra declares onlypyarrow.This is the minimal "Option A" fix from #1773: add
pandas>=1.0to theparquetextra so it matches the actual runtime surface ofParquetParser.Changes
pyproject.toml: addpandas>=1.0to theparquetextra. With this change,parquetandpandasextras are strictly redundant — which honestly reflects today's runtime coupling.CHANGELOG.md: entry under[Unreleased].Verification
Reproduced on
mainin a fresh venv (ModuleNotFoundError), verified fixed on this branch:pip install -e '.[parquet]'resolvespyarrow+pandasas expected.Resource('table.parquet').read_rows()returns rows cleanly.pytest frictionless/formats/parquet/__spec__/— 5 passed, 1 deselected (theci-marked remote-read).Out of scope (follow-ups for maintainers to weigh)
ParquetParserto iterate native pyarrowRecordBatches/to_pylist()without.to_pandas(). Larger change; would letparquetandpandasextras diverge again.TODOatparser.py:45-46. Unrelated to this bug.