Skip to content

Comments

Add support for reading/writing parquet files with fastparquet#253

Merged
huddlej merged 1 commit intomasterfrom
add-fastparquet
May 23, 2025
Merged

Add support for reading/writing parquet files with fastparquet#253
huddlej merged 1 commit intomasterfrom
add-fastparquet

Conversation

@huddlej
Copy link
Contributor

@huddlej huddlej commented May 23, 2025

Description of proposed changes

We need support for reading/writing parquet files to prepare submissions to the SARS-CoV-2 variant hub [1]. pandas supports two backends for parquet I/O [2] including pyarrow and fastparquet. The pyarrow library provides a more comprehensive set of tools for the Arrow spec [3], while fastparquet is defined to provide a minimal library for the parquet format.

I've opted for the smaller fastparquet library here, since it provides exactly the functionality we need for an additional 4 MB of Docker image size. The pyarrow library will eventually be a required dependency for pandas [4], so we may eventually need to include to that library. However, pyarrow adds 40 MB to the Docker image size most of which is functionality we don't need.

[1] nextstrain/forecasts-ncov#132
[2] https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#io-parquet
[3] https://arrow.apache.org/docs/cpp/user_guide.html
[4] https://pandas.pydata.org/pdeps/0010-required-pyarrow-dependency.html

Related issue(s)

Alternative to #252
Required for nextstrain/forecasts-ncov#132

Checklist

  • Checks pass

Test alternate approach to supporting parquet I/O using the fastparquet
library instead of pyarrow. Both libraries should produce similar
results, but fastparquet is smaller and focused solely on this format.
@huddlej huddlej merged commit 1f48980 into master May 23, 2025
61 checks passed
@huddlej huddlej deleted the add-fastparquet branch May 23, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant