-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Datetimelike equality comparisons with Categorical #38986
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
Changes from 3 commits
1fb45d8
bc39015
da043ac
156b0cb
949cbd7
613a3cb
3e71711
8a163a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,6 +162,20 @@ def _compare_other(self, s, data, op_name, other): | |
# with (some) integers, depending on the value. | ||
pass | ||
|
||
def test_compare_with_Categorical(self): | ||
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. We shouldn't add additional tests to this file (some other files in this directory have a note about that, just opened a PR to add that to this file as well -> #39003) @ftrihardjo can you move the test to eg |
||
result = pd.date_range("2020", periods=3) | ||
expected = pd.Categorical(result) | ||
assert all(result == expected) | ||
result = pd.date_range("2020", periods=3, tz="UTC") | ||
expected = pd.Categorical(result) | ||
assert all(result == expected) | ||
result = pd.timedelta_range("0 days", periods=3) | ||
expected = pd.Categorical(result) | ||
assert all(result == expected) | ||
result = pd.period_range("2020Q1", periods=3, freq="Q") | ||
expected = pd.Categorical(result) | ||
assert all(result == expected) | ||
|
||
|
||
class TestMissing(BaseDatetimeTests, base.BaseMissingTests): | ||
pass | ||
|
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.
can you parameterize this over the types (date_range and such),
also pls add a case for !=