COMPAT: Adapt to Numpy 2.0 dtype changes#57780
Merged
WillAyd merged 1 commit intopandas-dev:mainfrom Mar 8, 2024
Merged
Conversation
WillAyd
reviewed
Mar 8, 2024
|
|
||
| PyMODINIT_FUNC PyInit_pandas_datetime(void) { | ||
| PyDateTime_IMPORT; | ||
| import_array(); |
Member
There was a problem hiding this comment.
So this needs to be called any time you import ndarrayobject.h right? If so, I wonder if it wouldn't be cleaner to move the include here to the header. That way other module that need these datetime functions can simply include / link the pd_datetime capsule and not have to include ndarrayobject.h directly. May be less confusing
Contributor
Author
There was a problem hiding this comment.
Yes (if you use any API, but if you don't you only need ndarraytypes.h) but once per compilation unit only (just fixed that).
Places that use pd_datetime.h don't need it (we just need to be sure the init code ran).
Based on Thomas Li's work, but wanted to try and see that this is right. Co-authored-by: Thomas Li <[email protected]>
b0de2fe to
7d2e6d4
Compare
5 tasks
lithomas1
approved these changes
Mar 8, 2024
WillAyd
approved these changes
Mar 8, 2024
Member
|
@lithomas1 this needs backport right? |
Contributor
|
Mhm |
meeseeksmachine
pushed a commit
to meeseeksmachine/pandas
that referenced
this pull request
Mar 8, 2024
mroeschke
pushed a commit
that referenced
this pull request
Mar 8, 2024
…changes) (#57784) Backport PR #57780: COMPAT: Adapt to Numpy 2.0 dtype changes Co-authored-by: Sebastian Berg <[email protected]>
pmhatre1
pushed a commit
to pmhatre1/pandas-pmhatre1
that referenced
this pull request
May 7, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on Thomas Li's work, but wanted to try and see that this is right.
Replaces gh-13466.