Skip to content
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

Raise NotImplementedError in to_datetime with dayfirst without infer_format #14058

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

mroeschke
Copy link
Contributor

Description

Raises a NotImplementedError to avoid this incorrect behavior (which seems to actually not be implemented)

In [6]: cudf.to_datetime(["10-02-2014"], dayfirst=True)
Out[6]: DatetimeIndex(['2014-10-02'], dtype='datetime64[ns]')

closes #14042

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added bug Something isn't working Python Affects Python cuDF API. non-breaking Non-breaking change labels Sep 7, 2023
@mroeschke mroeschke requested a review from a team as a code owner September 7, 2023 18:09
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the modified test is failing to catch the expected error, perhaps the condition isn't quite right?

@mroeschke
Copy link
Contributor Author

Thanks for the catch. I needed to add a case to ignore empty data (which is "string dtype")

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 3b691f4 into rapidsai:branch-23.10 Sep 15, 2023
54 checks passed
@mroeschke mroeschke deleted the bug/to_datetime/dayfirst branch September 15, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] Should cudf.to_datetime(dayfirst=True) raise NotImplementedError?
2 participants