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

Restore usual instance/subclass checking to cudf.DateOffset #7029

Merged
merged 6 commits into from
Dec 17, 2020

Conversation

shwina
Copy link
Contributor

@shwina shwina commented Dec 17, 2020

pd.DateOffset uses a metaclass that overrides the usual instance/subclass checking behaviour. Any subclass of pd._libs.tslibs.offsets.BaseOffset will be reported as a subclass of pd.DateOffset (itself a pd.DateOffset). This can lead to some surprising behaviour:

In [3]: isinstance(pd.DateOffset(), cudf.DateOffset)
Out[3]: True

Note that cudf.DateOffset inherits from pd.DateOffset. But, a pd.DateOffset is reported as an instance of cudf.DateOffset -- Child Is Father of the Man!

@shwina shwina requested a review from a team as a code owner December 17, 2020 16:58
@shwina shwina added bug Something isn't working non-breaking Non-breaking change labels Dec 17, 2020
@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #7029 (85ee74c) into branch-0.18 (ae17c14) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           branch-0.18    #7029   +/-   ##
============================================
  Coverage        82.04%   82.05%           
============================================
  Files               96       96           
  Lines            16388    16395    +7     
============================================
+ Hits             13446    13453    +7     
  Misses            2942     2942           
Impacted Files Coverage Δ
python/cudf/cudf/core/tools/datetimes.py 83.73% <100.00%> (+0.71%) ⬆️

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 ae17c14...85ee74c. Read the comment docs.

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge 6 - Okay to Auto-Merge labels Dec 17, 2020
@rapids-bot rapids-bot bot merged commit 1c8f2a8 into rapidsai:branch-0.18 Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants