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

Fix to_timestamps to support Z for %z format specifier #10617

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

davidwendt
Copy link
Contributor

Closes #10609

This adds support for 'Z' in a timestamp string for the %z specifier. Normally, the %z specifier expects an hour-minute format like +HHMM but strptime and other libraries also accept a single 'Z' here. The following two strings should result in the same timestamp value: "2022-04-07 09:15:00Z" and "2022-04-07 09:15:00+0000"

The cudf::strings::is_timestamp and cudf::strings::to_timestamps have been updated to support this behavior. A gtest was updated to include this as a testcase.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python) non-breaking Non-breaking change labels Apr 7, 2022
@davidwendt davidwendt requested a review from a team as a code owner April 7, 2022 13:47
@davidwendt davidwendt self-assigned this Apr 7, 2022
@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #10617 (557114d) into branch-22.06 (956c7b5) will increase coverage by 0.03%.
The diff coverage is 88.97%.

@@               Coverage Diff                @@
##           branch-22.06   #10617      +/-   ##
================================================
+ Coverage         86.30%   86.34%   +0.03%     
================================================
  Files               140      140              
  Lines             22255    22280      +25     
================================================
+ Hits              19207    19237      +30     
+ Misses             3048     3043       -5     
Impacted Files Coverage Δ
python/cudf/cudf/core/frame.py 94.75% <ø> (+1.02%) ⬆️
python/dask_cudf/dask_cudf/tests/test_accessor.py 98.41% <ø> (ø)
python/cudf/cudf/core/indexed_frame.py 91.77% <87.93%> (-0.87%) ⬇️
python/cudf/cudf/core/column/lists.py 90.62% <100.00%> (+0.57%) ⬆️
python/cudf/cudf/core/dataframe.py 93.59% <100.00%> (ø)
python/cudf/cudf/core/series.py 95.28% <100.00%> (-0.01%) ⬇️
python/cudf/cudf/core/column/column.py 89.45% <0.00%> (+0.10%) ⬆️
python/cudf/cudf/core/column/string.py 89.10% <0.00%> (+0.12%) ⬆️
python/cudf/cudf/core/groupby/groupby.py 91.72% <0.00%> (+0.22%) ⬆️
python/cudf/cudf/core/tools/datetimes.py 84.49% <0.00%> (+0.30%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb03c8b...557114d. Read the comment docs.

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

LGTM!

@davidwendt
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit c8ffece into rapidsai:branch-22.06 Apr 11, 2022
@davidwendt davidwendt deleted the to-timestamps-Z-for-z branch April 11, 2022 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change strings strings issues (C++ and Python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] to_timestamps will need to handle %z format
4 participants