You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/31 14:36:29 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #14539: ARROW-2651: [Python] patch datetime C-api for PyPy

pitrou commented on code in PR #14539:
URL: https://github.com/apache/arrow/pull/14539#discussion_r1009494029


##########
python/pyarrow/src/arrow/python/datetime.h:
##########
@@ -32,16 +32,22 @@
 // C datetime API.  This is error-prone and potentially costly.
 // Instead, we redefine PyDateTimeAPI to point to a global variable,
 // which is initialized once by calling InitDatetime().
-#define PyDateTimeAPI ::arrow::py::internal::datetime_api
+#ifdef PYPY_VERSION
+#include "datetime.h"
+#else
+  #define PyDateTimeAPI ::arrow::py::internal::datetime_api

Review Comment:
   Can we keep indentation consistent?



##########
python/pyarrow/src/arrow/python/pyarrow.cc:
##########
@@ -40,7 +40,11 @@ static Status UnwrapError(PyObject* obj, const char* expected_type) {
 }
 
 int import_pyarrow() {
+#ifdef PYPY_VERSION
+PyDateTime_IMPORT;

Review Comment:
   Here as well.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org