Skip to content

fix: dtype inference in new_known_scalar #578

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

Conversation

pfackeldey
Copy link
Collaborator

closes #577

if a 0-dim array is passed to new_known_scalar the dtype was inferred to be np.dtype(type(array(...))) which results in object dtype. This PR directly uses the dtype of the input arg if it has a dtype attribute, which is true for array types.

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.10%. Comparing base (8cb8994) to head (6062dc7).
Report is 256 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #578      +/-   ##
==========================================
- Coverage   93.06%   92.10%   -0.97%     
==========================================
  Files          23       24       +1     
  Lines        3290     3598     +308     
==========================================
+ Hits         3062     3314     +252     
- Misses        228      284      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pfackeldey
Copy link
Collaborator Author

Needs #579 to fix the awkward-main ci test

@pfackeldey
Copy link
Collaborator Author

pfackeldey commented Apr 17, 2025

ugh... there seem to be the expectation of dask-awkward that a 0-dim typetracer array is always promoted to a length-1 layout. This is something that does not happen with every other array type. I explicitly fixed this in awkward recently: scikit-hep/awkward#3469 (comment), but dask-awkward seems to rely on it...

(needs #580 to be fixed)

@pfackeldey pfackeldey requested a review from martindurant April 17, 2025 19:30
@martindurant martindurant merged commit 94a6923 into dask-contrib:main Apr 18, 2025
37 of 39 checks passed
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.

Cannot use dak.num(events, axis=0) after having computed a slice of the events when open_files=False during reading
3 participants