Skip to content

Commit 69024a0

Browse files
jbrockmendeljreback
authored andcommitted
Explicitly define cmp_pandas_datetimestruct (pandas-dev#17750)
1 parent 9ac7c51 commit 69024a0

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

pandas/_libs/src/datetime/np_datetime.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ static void set_datetimestruct_days(npy_int64 days,
269269
/*
270270
* Compares two pandas_datetimestruct objects chronologically
271271
*/
272-
int cmp_pandas_datetimestruct(pandas_datetimestruct *a,
273-
pandas_datetimestruct *b) {
272+
int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
273+
const pandas_datetimestruct *b) {
274274
if (a->year > b->year) {
275275
return 1;
276276
} else if (a->year < b->year) {

pandas/_libs/src/datetime/np_datetime.h

+8
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
9999
npy_int64
100100
get_datetimestruct_days(const pandas_datetimestruct *dts);
101101

102+
103+
/*
104+
* Compares two pandas_datetimestruct objects chronologically
105+
*/
106+
int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
107+
const pandas_datetimestruct *b);
108+
109+
102110
/*
103111
* Adjusts a datetimestruct based on a minutes offset. Assumes
104112
* the current values are valid.

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ def pxd(name):
511511
'pxdfiles': ['_libs/src/util', '_libs/hashtable'],
512512
'depends': _pxi_dep['join']},
513513
'_libs.reshape': {'pyxfile': '_libs/reshape',
514-
'depends': _pxi_dep['reshape'], 'include': []},
514+
'depends': _pxi_dep['reshape']},
515515
'_libs.interval': {'pyxfile': '_libs/interval',
516516
'pxdfiles': ['_libs/hashtable'],
517517
'depends': _pxi_dep['interval']},
@@ -527,7 +527,7 @@ def pxd(name):
527527
'pandas/_libs/src/parser/io.c']},
528528
'_libs.sparse': {'pyxfile': '_libs/sparse',
529529
'depends': (['pandas/_libs/sparse.pyx'] +
530-
_pxi_dep['sparse']), 'include': []},
530+
_pxi_dep['sparse'])},
531531
'_libs.testing': {'pyxfile': '_libs/testing',
532532
'depends': ['pandas/_libs/testing.pyx']},
533533
'_libs.hashing': {'pyxfile': '_libs/hashing',

0 commit comments

Comments
 (0)