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

Add is_leap_year to DateTimeProperties and DatetimeIndex #8736

Merged
merged 2 commits into from
Jul 14, 2021

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Jul 13, 2021

Closes #8677

This PR adds is_leap_year for cudf.Series.dt and cudf.DatetimeIndex. Nulls in time series are treated as NaTs in Pandas time series and is mapped to False in this operation. E.g.

>>> s = cudf.Series(['2020-01-01 08:00:00', None, '2021-12-31 09:00:00'], dtype='datetime64[ns]')
>>> s.dt.is_leap_year
0     True
1    False
2    False
dtype: bool

@isVoid isVoid requested a review from a team as a code owner July 13, 2021 21:53
@github-actions github-actions bot added the Python Affects Python cuDF API. label Jul 13, 2021
@isVoid isVoid added feature request New feature or request non-breaking Non-breaking change 3 - Ready for Review Ready for review by team labels Jul 13, 2021
@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.08@3ed87f3). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head d31a4d5 differs from pull request most recent head e8764c5. Consider uploading reports for the commit e8764c5 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.08    #8736   +/-   ##
===============================================
  Coverage                ?   10.66%           
===============================================
  Files                   ?      109           
  Lines                   ?    18679           
  Branches                ?        0           
===============================================
  Hits                    ?     1993           
  Misses                  ?    16686           
  Partials                ?        0           

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 3ed87f3...e8764c5. Read the comment docs.

@shwina
Copy link
Contributor

shwina commented Jul 14, 2021

One small change required and then good to go

@shwina
Copy link
Contributor

shwina commented Jul 14, 2021

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 6ca7b58 into rapidsai:branch-21.08 Jul 14, 2021
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 feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Series datetime is_leap_year
3 participants