Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: placeholder array repr with extra info #3378

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

pfackeldey
Copy link
Collaborator

This PR fixes the repr of PlaceholderArrays for good by moving the array_str into the array module (nplike).

Currently the repr could be printed if no extra information is present, however, when a parameter exists (which is typically the case for e.g. coffea.NanoEvents that includes the __doc__ of a TBranch as a parameter) the repr was broken.

This should also be a more cleaner approach as it avoids runtime type dependent if conditions in certain parts of the codebase.

Copy link
Collaborator

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfackeldey - I'm a bit confused about TypeTracerArray. Do we support it?

src/awkward/contents/numpyarray.py Show resolved Hide resolved
Copy link
Collaborator

@ianna ianna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfackeldey - Thanks! I'm enabling auto-merge.

@ianna ianna enabled auto-merge (squash) January 23, 2025 14:39
@ianna ianna merged commit 966533d into main Jan 23, 2025
39 checks passed
@ianna ianna deleted the pfackeldey/fix_placeholderarray_repr_with_extra branch January 23, 2025 14:51
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.

2 participants