kou commented on code in PR #40418:
URL: https://github.com/apache/arrow/pull/40418#discussion_r1520400779


##########
python/pyarrow/src/arrow/python/numpy_interop.h:
##########
@@ -67,6 +67,13 @@
 #define NPY_INT32_IS_INT 0
 #endif
 
+// Backported NumPy 2 API (can be removed if numpy 2 is required)
+#if NPY_ABI_VERSION < 0x02000000
+#define PyDataType_ELSIZE(descr) ((descr)->elsize)
+#define PyDataType_C_METADATA(descr) ((descr)->c_metadata)
+#define PyDataType_FIELDS(descr) ((descr)->fields)
+#endif

Review Comment:
   Can we use the following until NumPy's Windows nightly wheel build is fixed?
   
   ```suggestion
   #ifndef PyDataType_ELSIZE
   #define PyDataType_ELSIZE(descr) ((descr)->elsize)
   #endif
   #ifndef PyDataType_C_METADATA
   #define PyDataType_C_METADATA(descr) ((descr)->c_metadata)
   #endif
   #ifndef PyDataType_FIELDS
   #define PyDataType_FIELDS(descr) ((descr)->fields)
   #endif
   ```



-- 
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]

Reply via email to