Skip to content

ENH: Period comparisons with mismatched freq use py3 behavior #39274

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

Merged
merged 3 commits into from
Jan 20, 2021

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. minor comments. ping on green.

@@ -354,12 +354,13 @@ def test_pi_cmp_nat_mismatched_freq_raises(self, freq):
idx1 = PeriodIndex(["2011-01", "2011-02", "NaT", "2011-05"], freq=freq)

diff = PeriodIndex(["2011-02", "2011-01", "2011-04", "NaT"], freq="4M")
msg = "Input has different freq=4M from Period(Array|Index)"
with pytest.raises(IncompatibleFrequency, match=msg):
msg = rf"Invalid comparison between dtype=period\[{freq}\] and PeriodArray"
Copy link
Contributor

Choose a reason for hiding this comment

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

prob should either rename the tests slightly or separate out the == case (and test != as well)

Copy link
Member Author

Choose a reason for hiding this comment

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

will rename for now. i think we may be able to re-use a helper from the dt64 tests, will take a look before long

@jreback jreback added the Period Period data type label Jan 19, 2021
@jreback jreback added this to the 1.3 milestone Jan 19, 2021
@jreback jreback merged commit 6b8442b into pandas-dev:master Jan 20, 2021
@jbrockmendel jbrockmendel deleted the enh-period-cmp branch January 20, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Period Period data type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants