Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support
freq
in DatetimeIndex #14593Support
freq
in DatetimeIndex #14593Changes from 16 commits
9602715
98e5e1e
6b0beee
20ca2bb
b461ecb
45fb6b2
f68a689
0337840
957c7c5
ed3ba3f
ce4f3bd
6ecc6e6
cd00345
6d00347
e1d2315
55266cd
e1b697f
32f622a
0d5c452
112dbc1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While looking on adding
freq
support before, I found some APIs manipulatefreq
(to new values) and return new results. (I vaguely remember..but I think that happens in binops?) Should we add a TODO comment here that this is not fully functional yet andfreq
support needs to be added in rest of the code-base?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, although maybe the default behaviour could be for
DatetimeIndex
to inferfreq
from its values. Then this should just work.Also, we should probably only do that in compatibility mode for perf reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some vague recollection that we left these out on purpose... hmm. I think there was some pandas behavior for which
"L"
and"ms"
were okay but"N"
,"U"
,"T"
, etc. were not supported. We'd probably be able to tell if there are any newly failing pandas tests? I'd just check to see where_CODES_TO_UNITS
is used and if there are any inconsistencies with this across different APIs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a bunch of failing tests without these changes, adding these units passed the cudf pytests.
There is only slight increase in pandas-pytest failures:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, thanks for checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better solved by fixing the condition on the parameter, which should be "pandas < 2.0"?
https://github.com/shwina/cudf/blob/ed3ba3ff17cf686d1e6e38f01073d27b1be64799/python/cudf/cudf/tests/test_datetime.py#L1512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to do that but it happens only for a few parameter combinations and we currently xpass/xfail strictly. That's the reason for the current approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we have two diverging approaches at the same place but I plan on dropping these in pandas-2.0 feature branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. We can clean it up later.