Skip to content

BUG: fix numpy datetime API to be compatible with older versions - #31821

Merged
kumaraditya303 merged 2 commits into
numpy:mainfrom
kumaraditya303:pandas-crash
Jul 1, 2026
Merged

kumaraditya303 merged 2 commits into
numpy:mainfrom
kumaraditya303:pandas-crash

Conversation

@kumaraditya303

Copy link
Copy Markdown
Contributor

PR summary

Fixes #31814

This PR fixes the pandas crash because cython definitons were using symbols which are only present on numpy 2.5 or above. This PR adds fallback just like other macros to directly access the fields on non-opaque so that it is compatible with numpy 2.4 or older.

AI Disclosure

None used.

@seberg seberg 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.

These diverging is clearly wrong, so LGTM, thanks for the quick fix!

This must be follow up with the API names/general cleanup before we release Python 3.15 wheels, though.

If you want to do this here, happy as well, otherwise please go ahead and just self-merge if you like.

@seberg seberg added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported 63 - C API Changes or additions to the C API. Mailing list should usually be notified. labels Jul 1, 2026
@seberg seberg added this to the 2.5.1 release milestone Jul 1, 2026
@kumaraditya303
kumaraditya303 merged commit 2a40aa3 into numpy:main Jul 1, 2026
87 checks passed
@kumaraditya303
kumaraditya303 deleted the pandas-crash branch July 1, 2026 10:55
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

00 - Bug 63 - C API Changes or additions to the C API. Mailing list should usually be notified.

Projects

None yet

3 participants