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

BUG: Datetimelike equality comparisons with Categorical #38986

Merged
merged 8 commits into from
Jan 8, 2021
Merged

BUG: Datetimelike equality comparisons with Categorical #38986

merged 8 commits into from
Jan 8, 2021

Conversation

ftrihardjo
Copy link
Contributor

@ftrihardjo ftrihardjo commented Jan 6, 2021

@jreback jreback changed the title pandas-dev issue #30699 BUG: Datetimelike equality comparisons with Categorical Jan 6, 2021
@jreback jreback added Testing pandas testing functions or related to the test suite Categorical Categorical Data Type Datetime Datetime data dtype labels Jan 6, 2021
@@ -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):
Copy link
Contributor

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 !=

@@ -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):
Copy link
Member

Choose a reason for hiding this comment

The 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 /tests/arrays/test_datetimelike.py ? (not fully sure what is the best place to put those nowadays) There also already seems to be a test_compare_categorical_dtype test in that file, so you can put it close to that one (or see to what extent it overlaps)

@@ -85,6 +85,24 @@ def test_compare_len1_raises(self):
with pytest.raises(ValueError, match="Lengths must match"):
idx <= idx[[0]]

def test_compare_with_Categorical(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you parameterize over pd.date_range,timedetla_range and period_range

@pep8speaks
Copy link

pep8speaks commented Jan 8, 2021

Hello @ftrihardjo! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-01-08 01:13:09 UTC

@jreback jreback added this to the 1.3 milestone Jan 8, 2021
@jreback jreback merged commit d25b169 into pandas-dev:master Jan 8, 2021
@jreback
Copy link
Contributor

jreback commented Jan 8, 2021

thanks @ftrihardjo

luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Datetime Datetime data dtype Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Datetimelike equality comparisons with Categorical
4 participants