fix: make ak.enforce_type work with typetracers#3764
fix: make ak.enforce_type work with typetracers#3764pfackeldey merged 17 commits intoscikit-hep:mainfrom
ak.enforce_type work with typetracers#3764Conversation
|
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.
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 |
pfackeldey
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
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.