-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
COMPAT: Adapt to Numpy 2.0 dtype changes #57780
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
@@ -255,5 +257,6 @@ static struct PyModuleDef pandas_datetimemodule = { | |||
|
|||
PyMODINIT_FUNC PyInit_pandas_datetime(void) { | |||
PyDateTime_IMPORT; | |||
import_array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@lithomas1 this needs backport right? |
Mhm |
…changes) (#57784) Backport PR #57780: COMPAT: Adapt to Numpy 2.0 dtype changes Co-authored-by: Sebastian Berg <[email protected]>
Based on Thomas Li's work, but wanted to try and see that this is right.
Replaces gh-13466.