fix: fix ak.validity_error for typetracer-backed layouts with unknown length#3784
Conversation
|
I am still now sure whether we should do length checks for typetracer-backed layouts with known lengths or whether we should guard with @pfackeldey any takes here? |
|
Regarding testing, I just modified all the existing tests to test against unknown length typetracers too. I found it useless to just copy the exact same lines of code to a new test file and duplicate that many lines in tests. |
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
ak.validity_check for typetracer-backed layouts with unknown lengthak.validity_error for typetracer-backed layouts with unknown length
|
The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3784 |
pfackeldey
left a comment
There was a problem hiding this comment.
Thanks @ikrommyd, looks good to me! These guards were already there for some layouts if I understand that correctly, but just missing for others. The test cases are only enhanced, not reduced/altered, so that's good for me 👍
ianna
left a comment
There was a problem hiding this comment.
This PR fixes ak.validity_error incorrectly failing on typetracer-backed layouts with unknown length by guarding length-dependent checks behind known_data. The change is systematic across multiple content types and aligns validity semantics with typetracer expectations. Tests are extended to cover forget_length=True, preventing regressions. Overall: a correct, minimal, and well-tested fix for a real typetracer bug.
|
Thanks, I will go ahead and merge it then. Indeed @pfackeldey, it was there for some layouts but not for others. These are all the code paths I found by enabling testing. |
Fixes #3776