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


##########
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:
   Hmmm, I guess it bites us that we don't have more fine grained patch 
versions :(.  Those are defined as static inline functions unfortunately.  You 
could put `#ifndef _PyArray_DescrNumPy2`, but it would be a temporary 
work-around :(.



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