add support for writing parquet files#642
Merged
haimasree merged 6 commits intokipoi:masterfrom Feb 10, 2022
Merged
Conversation
haimasree
requested changes
Feb 10, 2022
| chunk_size = 10000 | ||
|
|
||
| # optional import of pyarrow | ||
| import pyarrow as pa |
Contributor
There was a problem hiding this comment.
So CI is telling me that pyarrow is not installed. I dont see it in any dev-requirements-py*. yml either. Perhaps try adding pyarrow in kipoi setup.py?
Contributor
There was a problem hiding this comment.
The exact error is ModuleNotFoundError: No module named 'pyarrow'
Member
Author
There was a problem hiding this comment.
Thanks! Yes, I have to add it as an optional dependency 👍
Contributor
|
I will merge this and remove the coverall for now. I will check tomorrow why the REPO token is not working anymore. |
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.
This PR adds support for writing parquet files.
In particular, it adds two additional parquet writer implementations:
ParquetFileBatchWriter: Writes to a single parquet file and depends on PyArrow.ParquetDirBatchWriter: Writes a directory of parquet files usingpandas.to_parquet(). Supports both PyArrow and fastparquet. This implementation is predestined for multi-processing / asynchronous writing since no file-locking is necessary for it. Nevertheless, I'm not sure yet how Kipoi would take advantage of that.My very long-term goal is that we directly provide schemas as Arrow schemas to be able to pass them around cross-language without any kind of conversion/serialization:
https://arrow.apache.org/docs/python/api/datatypes.html
This PR is the first step in that direction.
Future work: