-
Notifications
You must be signed in to change notification settings - Fork 101
fix: make ak.enforce_type work with typetracers
#3764
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
base: main
Are you sure you want to change the base?
fix: make ak.enforce_type work with typetracers
#3764
Conversation
|
Opening it as draft as I need to add tests for many possible combinations for the enforce type arguments. This is what I only saw immediately to break the infinite recursion reported in the issue. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
|
The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3764 |
pfackeldey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ikrommyd!
This looks like the correct fix, I've tested and confirmed it locally as well. There may be certainly cases like this one where special typetracer handling has been overlooked in the past.
Please add the test as you suggested, then I think it's ready from my side.
|
@pfackeldey I have added 1K lines of tests all taken from https://github.com/scikit-hep/awkward/blob/main/tests/test_2365_enforce_type.py. However, if you slice out the number and keep the string only, it is computable even So during tracing you need to assume that your type enforcement actually works until you look at the data. In general, a few minor changes were needed. Inspired from the fact that Lines 87 to 88 in 0ad8b1e
so from_buffers should too.
This should be ready for review from my side. |
|
To support this PR more, I have exposed it to the public API of dask-awkward in this commit in my fork and have added tests for it: dask-contrib/dask-awkward@43fa7ef. They all pass with |
Closes #3736
As the title says, this makes
ak.enforce_typework with typetracers. This is needed in order to makedak.enforce_typework in dask-awkward.