Skip to content

CLN: Remove PeriodIndex.tz_convert, tz_localize #21935

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 9 commits into from
Jul 18, 2018
Merged

CLN: Remove PeriodIndex.tz_convert, tz_localize #21935

merged 9 commits into from
Jul 18, 2018

Conversation

jquinon
Copy link
Contributor

@jquinon jquinon commented Jul 16, 2018

  • closes remove PeriodIndex.tz_convert, tz_localize? #21781

  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

  • Removed PeriodIndex.tz_convert and PeriodIndex.tz_localize from PeriodIndex.

  • Removed references to those methods in test_tz_convert_and_localize within test_timeseries

  • Removed methods from the PeriodIndex class doc and updated whatsnew

test_tz_convert_and_localize also contains a TODO referencing changing the test to use PeriodIndex for a timezone test, which if it is never gaining timezone info should probably be removed. I just wanted to check that this was a good idea before doing it.

@jbrockmendel
Copy link
Member

There's a linting problem in the test file.

Other than that, assuming there's a consensus about removing these, LGTM.

@codecov
Copy link

codecov bot commented Jul 16, 2018

Codecov Report

Merging #21935 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21935      +/-   ##
==========================================
+ Coverage   91.96%   91.96%   +<.01%     
==========================================
  Files         166      166              
  Lines       50323    50329       +6     
==========================================
+ Hits        46281    46287       +6     
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.36% <ø> (ø) ⬆️
#single 42.23% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/indexes/period.py 93.17% <ø> (-0.04%) ⬇️
pandas/core/common.py 92.08% <0%> (-0.12%) ⬇️
pandas/core/frame.py 97.19% <0%> (ø) ⬆️
pandas/core/generic.py 96.46% <0%> (ø) ⬆️
pandas/core/panel.py 97.44% <0%> (ø) ⬆️
pandas/core/series.py 94.11% <0%> (ø) ⬆️
pandas/core/indexes/base.py 96.35% <0%> (ø) ⬆️
pandas/core/reshape/concat.py 97.6% <0%> (ø) ⬆️
pandas/core/sparse/frame.py 94.79% <0%> (+0.01%) ⬆️
pandas/core/sparse/series.py 95.22% <0%> (+0.01%) ⬆️
... and 1 more

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 272bbdc...f46f848. Read the comment docs.

@gfyoung gfyoung added Error Reporting Incorrect or improved errors from pandas Timezones Timezone data dtype labels Jul 16, 2018
@@ -322,7 +322,7 @@ Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`)
-
- :meth:`PeriodIndex.tz_convert` and :meth:`PeriodIndex.tz_localize` have been removed (:issue:`21781`)
Copy link
Member

@gfyoung gfyoung Jul 16, 2018

Choose a reason for hiding this comment

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

Should go in the Other API Changes section. We generally reserve this area for actual deprecations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, gotcha

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also I tried to document the changes made in api.rst, but removing the methods caused a bunch of errors in the build. Do you know what is causing that? Do I need to build the docs?

Copy link
Member

Choose a reason for hiding this comment

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

Not sure ATM. If there's anything to remove in api.rst (or any of the .rst files), it would be reference to the methods that you just removed.

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 move to Other API canges, otherwise lgtm.

Copy link
Contributor

Choose a reason for hiding this comment

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

ping when this is moved

@jreback jreback added this to the 0.24.0 milestone Jul 16, 2018
@@ -322,7 +322,7 @@ Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- The ``LongPanel`` and ``WidePanel`` classes have been removed (:issue:`10892`)
-
- :meth:`PeriodIndex.tz_convert` and :meth:`PeriodIndex.tz_localize` have been removed (:issue:`21781`)
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 move to Other API canges, otherwise lgtm.

@@ -779,10 +778,7 @@ def test_tz_convert_and_localize(self, fn):

# TODO: l1 should be a PeriodIndex for testing
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this comment

period_range('20140701', periods=1).tz_convert('UTC')
with pytest.raises(NotImplementedError):
period_range('20140701', periods=1).tz_localize('UTC')

# l1 = period_range('20140701', periods=5, freq='D')
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment out as well

@jquinon
Copy link
Contributor Author

jquinon commented Jul 18, 2018

@jreback Everything look good?

@gfyoung gfyoung merged commit 4b73f22 into pandas-dev:master Jul 18, 2018
@gfyoung
Copy link
Member

gfyoung commented Jul 18, 2018

@jquinon : Everyone seems happy, so yes, indeed! Thanks!

@jquinon jquinon deleted the PeriodIndexCleanUp branch July 19, 2018 19:45
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Jul 20, 2018
CLN: Removed tz_convert and tz_localize from PeriodIndex

Closes pandas-devgh-21781
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
CLN: Removed tz_convert and tz_localize from PeriodIndex

Closes pandas-devgh-21781
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove PeriodIndex.tz_convert, tz_localize?
5 participants