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 DateOffset eq to depend on normalize attr #21404

Merged
merged 5 commits into from Jun 13, 2018

Conversation

Projects
None yet
3 participants
@jbrockmendel
Copy link
Member

commented Jun 10, 2018

This has a bullet point in #18854 but doesn't appear to have its own issue.

Current:

now = pd.Timestamp.now()
off = pd.offsets.Week(n=1, normalize=False)
normed = pd.offsets.Week(n=1, normalize=True)

>>> now + off == now + normed
False
>>> off == normed  # PR changes this comparison to False
True
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

jbrockmendel added some commits Jun 10, 2018

# GH#???? changed __eq__ to return False when `normalize` doesnt match
offset = self._offset()
offset2 = self._offset(normalize=True)
assert offset != offset2

This comment has been minimized.

Copy link
@jbrockmendel

jbrockmendel Jun 10, 2018

Author Member

After substituting in self._offset for BDay, this test is identical to 5 others in this file. I'm putting together a separate PR to try to de-duplicate and parametrize a bunch of things like this.

@codecov

This comment has been minimized.

Copy link

commented Jun 10, 2018

Codecov Report

Merging #21404 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21404   +/-   ##
=======================================
  Coverage    91.9%    91.9%           
=======================================
  Files         153      153           
  Lines       49606    49606           
=======================================
  Hits        45589    45589           
  Misses       4017     4017
Flag Coverage Δ
#multiple 90.3% <100%> (ø) ⬆️
#single 41.89% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/tseries/offsets.py 97.24% <100%> (ø) ⬆️

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 576d5c6...b902cb1. Read the comment docs.

@gfyoung

This comment has been minimized.

Copy link
Member

commented Jun 10, 2018

This has a bullet point in #18854 but doesn't appear to have its own issue.

@jbrockmendel : How about this one here: #17689? It might be a little familiar to you. 😉

@gfyoung
Copy link
Member

left a comment

This looks good to me!

cc @jreback

@jreback jreback added this to the 0.24.0 milestone Jun 12, 2018

@jreback
Copy link
Contributor

left a comment

looks good. minor comment. ping on green.

@@ -91,7 +91,7 @@ Categorical
Datetimelike
^^^^^^^^^^^^

-
- Fixed Bug where two :class:`DateOffset` objects with different `normalize` attributes could evaluate as equal (:issue:`21404`)

This comment has been minimized.

Copy link
@jreback

jreback Jun 12, 2018

Contributor

double backticks on normalize

@gfyoung

This comment has been minimized.

Copy link
Member

commented Jun 12, 2018

@jreback : Everything is green here.

@jreback

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2018

I merged something which now causes a conflict here. @jbrockmendel can you rebase. @gfyoung can merge on green.

@gfyoung gfyoung merged commit b5fc769 into pandas-dev:master Jun 13, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@gfyoung

This comment has been minimized.

Copy link
Member

commented Jun 13, 2018

Thanks @jbrockmendel !

This was referenced Jun 13, 2018

david-liu-brattle-1 added a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 18, 2018

david-liu-brattle-1 added a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 19, 2018

@jbrockmendel jbrockmendel referenced this pull request Jun 21, 2018

Open

tslibs TODO list #17652

28 of 59 tasks complete

@jbrockmendel jbrockmendel deleted the jbrockmendel:cmp_normalize branch Jun 22, 2018

alimcmaster1 added a commit to alimcmaster1/pandas that referenced this pull request Jun 28, 2018

alimcmaster1 added a commit to alimcmaster1/pandas that referenced this pull request Jun 28, 2018

Sup3rGeo added a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.