Conversation
A Table can carry the array's attrs in its schema metadata, under the same `AWKWARD_ATTRS` key that Parquet already uses. A bare Arrow array has nowhere to put them other than its type, so `ak.to_arrow` stores them in the outermost `AwkwardArrowType` (and can therefore only do so with `extensionarray=True`). Either way, `ak.from_arrow` restores them, with an explicit `attrs` argument taking precedence. Transient attrs (whose keys start with "@") are dropped, as they are when pickling. Signed-off-by: Iason Krommydas <iason.krom@gmail.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (96.96%) is below the target coverage (98.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files
|
Contributor
|
The documentation preview is ready to be viewed at https://awkward-array.org/doc/pr/4349/ |
This branch has not been deployed
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.
Closes #3278
Parquet already writes the attrs into the table's schema metadata, so
ak.to_arrow_tabledoes the same under the same key. A bare Arrow array has nowhere to put them other than its type, soak.to_arrowstores them in the outermostAwkwardArrowType, which means it can only do it withextensionarray=True. Either wayak.from_arrowrestores them, and an explicitattrsargument takes precedence. Transient attrs are dropped, as they are when pickling.The second commit moves the parquet side onto the same two helpers instead of repeating the metadata key and the json handling in
ak_to_parquetandak_from_parquet.