Skip to content

Commit 283d9d3

Browse files
authored
suggestion
1 parent 3c8a660 commit 283d9d3

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pandas/_libs/src/vendored/numpy/datetime/np_datetime.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,11 +1070,8 @@ void pandas_timedelta_to_timedeltastruct(npy_timedelta td,
10701070
*/
10711071
PyArray_DatetimeMetaData
10721072
get_datetime_metadata_from_dtype(PyArray_Descr *dtype) {
1073-
#if NPY_ABI_VERSION >= 0x02000000
1074-
// we're compiling with numpy > 2.0
1075-
_PyArray_LegacyDescr *ldtype = (_PyArray_LegacyDescr *)dtype;
1076-
return (((PyArray_DatetimeDTypeMetaData *)ldtype->c_metadata)->meta);
1077-
#else
1078-
return (((PyArray_DatetimeDTypeMetaData *)dtype->c_metadata)->meta);
1079-
#endif
1073+
#if NPY_ABI_VERSION < 0x02000000
1074+
#define PyDataType_C_METADATA(descr) ((descr)->c_metadata)
1075+
#endif
1076+
return (PyDataType_C_METADATA(descr)->meta);
10801077
}

0 commit comments

Comments
 (0)