Skip to content

Explicitly define cmp_pandas_datetimestruct #17750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/_libs/src/datetime/np_datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ static void set_datetimestruct_days(npy_int64 days,
/*
* Compares two pandas_datetimestruct objects chronologically
*/
int cmp_pandas_datetimestruct(pandas_datetimestruct *a,
pandas_datetimestruct *b) {
int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
const pandas_datetimestruct *b) {
if (a->year > b->year) {
return 1;
} else if (a->year < b->year) {
Expand Down
8 changes: 8 additions & 0 deletions pandas/_libs/src/datetime/np_datetime.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@ convert_datetimestruct_to_datetime(pandas_datetime_metadata *meta,
npy_int64
get_datetimestruct_days(const pandas_datetimestruct *dts);


/*
* Compares two pandas_datetimestruct objects chronologically
*/
int cmp_pandas_datetimestruct(const pandas_datetimestruct *a,
const pandas_datetimestruct *b);


/*
* Adjusts a datetimestruct based on a minutes offset. Assumes
* the current values are valid.
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def pxd(name):
'pxdfiles': ['_libs/src/util', '_libs/hashtable'],
'depends': _pxi_dep['join']},
'_libs.reshape': {'pyxfile': '_libs/reshape',
'depends': _pxi_dep['reshape'], 'include': []},
'depends': _pxi_dep['reshape']},
'_libs.interval': {'pyxfile': '_libs/interval',
'pxdfiles': ['_libs/hashtable'],
'depends': _pxi_dep['interval']},
Expand All @@ -527,7 +527,7 @@ def pxd(name):
'pandas/_libs/src/parser/io.c']},
'_libs.sparse': {'pyxfile': '_libs/sparse',
'depends': (['pandas/_libs/sparse.pyx'] +
_pxi_dep['sparse']), 'include': []},
_pxi_dep['sparse'])},
'_libs.testing': {'pyxfile': '_libs/testing',
'depends': ['pandas/_libs/testing.pyx']},
'_libs.hashing': {'pyxfile': '_libs/hashing',
Expand Down