Skip to content

fix: ak.array_equal with datetimes and timedeltas with NaTs#3921

Merged
ikrommyd merged 2 commits into
scikit-hep:mainfrom
ikrommyd:fix-array-equal-datetime-timedelta
Mar 18, 2026
Merged

fix: ak.array_equal with datetimes and timedeltas with NaTs#3921
ikrommyd merged 2 commits into
scikit-hep:mainfrom
ikrommyd:fix-array-equal-datetime-timedelta

Conversation

@ikrommyd

Copy link
Copy Markdown
Member

backend.nplike.all(left.data == right.data) does not respect equal_nan=True. We should use something that does like backend.nplike.array_equal

@github-actions

Copy link
Copy Markdown

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3921

@codecov

codecov Bot commented Mar 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.34%. Comparing base (441d5bd) to head (a28ad8f).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/operations/ak_almost_equal.py 98.18% <ø> (ø)

... and 6 files with indirect coverage changes

@TaiSakuma TaiSakuma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great. Now, array_equal() works with NaN.

Comment thread tests/test_3921_array_equal_datetime_and_timedelta.py
@ikrommyd
ikrommyd merged commit 3c6b01b into scikit-hep:main Mar 18, 2026
41 checks passed
@ikrommyd
ikrommyd deleted the fix-array-equal-datetime-timedelta branch March 18, 2026 21:12

@ianna ianna left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ikrommyd - Thanks! A belated comment - it would look better in the release notes if the PR title did not repeat fix: fix -- I think a fix: would be enough.

@ikrommyd

ikrommyd commented Mar 18, 2026

Copy link
Copy Markdown
Member Author

I think changing it now will be reflected on the release notes so that’s fine.

@ikrommyd ikrommyd changed the title fix: fix ak.array_equal with datetimes and timedeltas with NaTs fix: ak.array_by equal with datetimes and timedeltas with NaTs Mar 18, 2026
@ikrommyd ikrommyd changed the title fix: ak.array_by equal with datetimes and timedeltas with NaTs fix: ak.array_equal with datetimes and timedeltas with NaTs Mar 18, 2026
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.

3 participants