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

CLN: standardize different freq message #24283

Merged
merged 8 commits into from
Dec 16, 2018

Conversation

jbrockmendel
Copy link
Member

In #24282 some of the PeriodArray/PeriodIndex methods couldn't accept the decorator because of mismatches between _DIFFERENT_FREQ and DIFFERENT_FREQ_INDEX. This unifies the two.

The remaining case to figure out is what to render for other_freq when dealing with an ndarray. Right now the placeholder is "FIXME".

@pep8speaks
Copy link

pep8speaks commented Dec 14, 2018

Hello @jbrockmendel! Thanks for updating the PR.

Comment last updated on December 14, 2018 at 22:23 Hours UTC

@TomAugspurger
Copy link
Contributor

Perhaps hold off on this for #24024, which is changing (some) of these to use _check_compatiable_with.

I suppose that would be a relatively easy fix to split off from #24024, and it'd mean fewer changes here as well.

freqstr=self.freqstr))
if np.ndim(other) > 0:
# FIXME: What should this be rendered as?
other_freq = "FIXME"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does "None" make sense here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Either that or something resembling a least common denominator. None sounds easier.

@jbrockmendel
Copy link
Member Author

I suppose that would be a relatively easy fix to split off from #24024, and it'd mean fewer changes here as well.

+1

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Dec 14, 2018 via email

@jreback jreback added Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Frequency DateOffsets labels Dec 14, 2018
@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #24283 into master will increase coverage by <.01%.
The diff coverage is 88.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24283      +/-   ##
==========================================
+ Coverage   92.22%   92.22%   +<.01%     
==========================================
  Files         162      162              
  Lines       51828    51836       +8     
==========================================
+ Hits        47799    47807       +8     
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.63% <88.46%> (ø) ⬆️
#single 43% <3.84%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/datetimelike.py 96.44% <100%> (ø) ⬆️
pandas/core/arrays/period.py 98.52% <100%> (+0.02%) ⬆️
pandas/core/indexes/period.py 93.06% <50%> (ø) ⬆️

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 d564c42...b6d5138. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #24283 into master will increase coverage by <.01%.
The diff coverage is 86.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24283      +/-   ##
==========================================
+ Coverage   92.22%   92.22%   +<.01%     
==========================================
  Files         162      162              
  Lines       51824    51828       +4     
==========================================
+ Hits        47795    47799       +4     
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.62% <86.95%> (ø) ⬆️
#single 43.01% <8.69%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/datetimelike.py 96.44% <100%> (ø) ⬆️
pandas/core/arrays/period.py 98.5% <100%> (+0.01%) ⬆️
pandas/core/indexes/period.py 93.06% <50%> (ø) ⬆️

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 a7bc7eb...a72f6ce. Read the comment docs.

@jreback jreback added this to the 0.24.0 milestone Dec 16, 2018
@jreback
Copy link
Contributor

jreback commented Dec 16, 2018

lgtm. @TomAugspurger if ok for you to merge ping (or merge)

@@ -372,15 +372,13 @@ def __setitem__(
value = period_array(value)

if self.freqstr != value.freqstr:
Copy link
Contributor

Choose a reason for hiding this comment

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

PeriodArray.__setitem__ is being removed, so I was hoping to not change these.

@TomAugspurger TomAugspurger merged commit 6c767c5 into pandas-dev:master Dec 16, 2018
@jbrockmendel jbrockmendel deleted the pmsg branch December 16, 2018 15:41
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* standardize different freq message

* implement raise_on_incompatible

* fixup missing import

* freqstr cases

* update tested messages
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
* standardize different freq message

* implement raise_on_incompatible

* fixup missing import

* freqstr cases

* update tested messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Error Reporting Incorrect or improved errors from pandas Frequency DateOffsets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants