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
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7506bc7
fix DateOffset eq to depend on normalize attr
jbrockmendel e12329e
Fill in GH refernece
jbrockmendel ee9d96d
more backticks
jbrockmendel 444418c
Merge branch 'master' of https://github.com/pandas-dev/pandas into cm…
jbrockmendel b902cb1
Merge branch 'master' of https://github.com/pandas-dev/pandas into cm…
jbrockmendel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,11 +518,10 @@ def setup_method(self, method): | |
self.offset2 = BDay(2) | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
offset = BDay() | ||
offset2 = BDay() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After substituting in |
||
|
||
def test_repr(self): | ||
assert repr(self.offset) == '<BusinessDay>' | ||
|
@@ -713,11 +712,10 @@ def test_constructor_errors(self): | |
BusinessHour(start='14:00:05') | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
|
||
def test_repr(self): | ||
assert repr(self.offset1) == '<BusinessHour: BH=09:00-17:00>' | ||
|
@@ -1391,11 +1389,10 @@ def test_constructor_errors(self): | |
CustomBusinessHour(start='14:00:05') | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
|
||
def test_repr(self): | ||
assert repr(self.offset1) == '<CustomBusinessHour: CBH=09:00-17:00>' | ||
|
@@ -1632,11 +1629,10 @@ def setup_method(self, method): | |
self.offset2 = CDay(2) | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
offset = CDay() | ||
offset2 = CDay() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
|
||
def test_repr(self): | ||
assert repr(self.offset) == '<CustomBusinessDay>' | ||
|
@@ -1916,13 +1912,13 @@ def test_copy(self): | |
|
||
class TestCustomBusinessMonthEnd(CustomBusinessMonthBase, Base): | ||
_object = CBMonthEnd | ||
_offset = CBMonthEnd | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
offset = CBMonthEnd() | ||
offset2 = CBMonthEnd() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
|
||
def test_repr(self): | ||
assert repr(self.offset) == '<CustomBusinessMonthEnd>' | ||
|
@@ -2033,13 +2029,13 @@ def test_datetimeindex(self): | |
|
||
class TestCustomBusinessMonthBegin(CustomBusinessMonthBase, Base): | ||
_object = CBMonthBegin | ||
_offset = CBMonthBegin | ||
|
||
def test_different_normalize_equals(self): | ||
# equivalent in this special case | ||
offset = CBMonthBegin() | ||
offset2 = CBMonthBegin() | ||
offset2.normalize = True | ||
assert offset == offset2 | ||
# GH#21404 changed __eq__ to return False when `normalize` doesnt match | ||
offset = self._offset() | ||
offset2 = self._offset(normalize=True) | ||
assert offset != offset2 | ||
|
||
def test_repr(self): | ||
assert repr(self.offset) == '<CustomBusinessMonthBegin>' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double backticks on normalize