Skip to content

CLN: Remove .to_datetime methods #18648

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 1 commit into from
Dec 6, 2017

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Dec 5, 2017

Removes the following .to_datetime methods

  • Index.to_datetime
  • Timestamp.to_datetime
  • PeriodIndex.to_datetime
  • DatetimeIndex.to_datetime

All were deprecated in 0.19.0

xref #8254, #14096, #14113

@gfyoung gfyoung added Clean Deprecate Functionality to remove in pandas labels Dec 5, 2017
@gfyoung gfyoung added this to the 0.22.0 milestone Dec 5, 2017
@gfyoung
Copy link
Member Author

gfyoung commented Dec 5, 2017

Oops, I forgot some flake8 stuff before pushing. Will fix those later today.

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.

looks fine. merge on all green. be sure to grep the docs to see if we are actually using this anywhere (besides api.rst), obviously this is tricky as we use pd.to_datetime() all over the place and this matches.

@@ -888,12 +870,6 @@ def test_to_datetime_list_of_integers(self):

tm.assert_index_equal(rng, result)

def test_to_datetime_freq(self):
xp = bdate_range('2000-1-1', periods=10, tz='UTC')
rs = xp.to_datetime()
Copy link
Contributor

Choose a reason for hiding this comment

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

odd that this didn't warn before

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, indeed...

Removes the following .to_datetime methods

* Index.to_datetime
* NaTType.to_datetime
* Timestamp.to_datetime
* PeriodIndex.to_datetime
* DatetimeIndex.to_datetime

All were deprecated in 0.19.0

xref pandas-devgh-8254, pandas-devgh-14096, pandas-devgh-14113
@codecov
Copy link

codecov bot commented Dec 6, 2017

Codecov Report

Merging #18648 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18648      +/-   ##
==========================================
- Coverage   91.59%   91.58%   -0.02%     
==========================================
  Files         153      153              
  Lines       51221    51236      +15     
==========================================
+ Hits        46917    46924       +7     
- Misses       4304     4312       +8
Flag Coverage Δ
#multiple 89.44% <ø> (ø) ⬆️
#single 40.68% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/period.py 92.91% <ø> (-0.04%) ⬇️
pandas/core/indexes/datetimes.py 95.68% <ø> (-0.01%) ⬇️
pandas/core/indexes/base.py 96.43% <ø> (-0.02%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/tseries/offsets.py 96.9% <0%> (+0.03%) ⬆️
pandas/core/window.py 96.37% <0%> (+0.06%) ⬆️
pandas/stats/moments.py 71.19% <0%> (+0.38%) ⬆️

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 13f6267...c4977d5. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 6, 2017

Codecov Report

Merging #18648 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18648      +/-   ##
==========================================
- Coverage   91.59%   91.55%   -0.05%     
==========================================
  Files         153      153              
  Lines       51221    51205      -16     
==========================================
- Hits        46917    46880      -37     
- Misses       4304     4325      +21
Flag Coverage Δ
#multiple 89.41% <ø> (-0.03%) ⬇️
#single 40.67% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/period.py 92.9% <ø> (-0.05%) ⬇️
pandas/core/indexes/datetimes.py 95.68% <ø> (-0.01%) ⬇️
pandas/core/indexes/base.py 96.43% <ø> (-0.02%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/plotting/_converter.py 63.44% <0%> (-1.82%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️

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 13f6267...c4977d5. Read the comment docs.

@gfyoung
Copy link
Member Author

gfyoung commented Dec 6, 2017

All is green, so merging.

@gfyoung gfyoung merged commit 537c06d into pandas-dev:master Dec 6, 2017
@gfyoung gfyoung deleted the to-datetime-drop branch December 6, 2017 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants