-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
ENH: expose datetime64 conversion functions #16364
Conversation
@@ -287,8 +286,7 @@ convert_timedelta_to_pyobject(npy_timedelta td, PyArray_DatetimeMetaData *meta); | |||
/* | |||
* Converts a datetime based on the given metadata into a datetimestruct | |||
*/ | |||
NPY_NO_EXPORT int | |||
convert_datetime_to_datetimestruct(PyArray_DatetimeMetaData *meta, | |||
int convert_datetime_to_datetimestruct(PyArray_DatetimeMetaData *meta, |
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.
I don't think this is sufficient, extension modules aren't allowed to link against each other. This needs to go through the function table like the other NUMPY_API
functions.
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.
Thanks, ill see if i can track that down. Before I do, is this likely to be accepted once working?
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.
I think we'd need to think about the function names, but in principle it seems sensible to me to expose the npy_datetimestruct
type and some APIs that consume it.
For completeness we might want to upstream the timedelta changes as well: Probably in a separate PR, maybe a pre-cursor. The above is used in JSON so I think we wouldn't be able to completely simplify our dependency structure without tacking that as well |
@eric-wieser Not sure why this is tagged random. |
@bashtage best guess is that on a previous PR implementing test_cython we adapted the setup from random.tests.test_extending into a fixture and there was an offhand mention of using that pattern in the random tests. |
Closing in favor of #21199. |
These would allow pandas to remove our copy/pasted implementations.
cc @WillAyd @mroeschke anything else we might need?