jorisvandenbossche commented on code in PR #51374: URL: https://github.com/apache/arrow/pull/51374#discussion_r4230220537
########## python/pyarrow/src/arrow/python/datetime.h: ########## @@ -38,7 +39,79 @@ # include "datetime.h" #else # define PyDateTimeAPI ::arrow::py::internal::datetime_api -#endif + +// Under Py_LIMITED_API (the cp311-abi3 build) CPython's <datetime.h> is +// entirely absent (it lives behind #ifndef Py_LIMITED_API), so neither the +// PyDateTime_CAPI struct nor the PyDate_Check / PyDate_FromDate macros are +// provided. The datetime C-API is still exposed at runtime through the +// "datetime.datetime_CAPI" capsule (which InitDatetime() imports and stores in +// datetime_api); the struct layout is a documented, stable part of that +// capsule contract. Define the struct and the check/constructor macros we use Review Comment: I don't think this is true? The python docs (https://docs.python.org/3/c-api/datetime.html#c.PyDateTime_CAPI) explicitly say "The fields of this structure are private and subject to change.") -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
