Skip to content

DEPR: remove pd.TimeSeries & Series.is_time_series #15098

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

Closed
wants to merge 2 commits into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Jan 10, 2017

xref #10890

@jreback jreback added the Deprecate Functionality to remove in pandas label Jan 10, 2017
@jreback jreback added this to the 0.20.0 milestone Jan 10, 2017
@jreback jreback force-pushed the time_series branch 2 times, most recently from 69f9441 to 6adcf80 Compare January 10, 2017 15:35
@codecov-io
Copy link

codecov-io commented Jan 10, 2017

Codecov Report

Merging #15098 into master will increase coverage by 0.67%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #15098      +/-   ##
==========================================
+ Coverage   90.36%   91.04%   +0.67%     
==========================================
  Files         136      136              
  Lines       49552    49091     -461     
==========================================
- Hits        44780    44694      -86     
+ Misses       4772     4397     -375
Impacted Files Coverage Δ
pandas/compat/pickle_compat.py 68.29% <ø> (ø)
pandas/io/pytables.py 93.05% <ø> (-0.86%)
pandas/core/series.py 94.93% <ø> (-0.04%)
pandas/core/api.py 100% <100%> (ø)
pandas/util/decorators.py 67.32% <0%> (-1.28%)
pandas/core/frame.py 97.73% <0%> (-0.1%)
pandas/util/print_versions.py 15.71% <0%> (ø)
pandas/core/groupby.py 95% <0%> (+0.01%)
pandas/types/cast.py 85.65% <0%> (+0.2%)
... 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 e15de4d...d9101bc. Read the comment docs.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

+1!

Just some comments about the wording on pickle compat.

You removed all legacy pickles for versions < 0.13. Is that because just all files we were testing contained a time series? (I suppose that pickles files that do not have a TimeSeries in it can still be read in?)

``pd.TimeSeries`` was deprecated officially in 0.17.0, though has only been an alias since 0.13.0. It has
been dropped in favor of ``pd.Series``.

This *may* cause pickles / HDF5 files that were created with the ``pd.TimeSeries`` to become unreadable. (:issue:``15098).
Copy link
Member

Choose a reason for hiding this comment

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

Can you add how to solve this? (I suppose reading it in with older pandas version, and saving it again? Or is that not enough to remove the 'TimeSeries' aspect)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes that's exactly how to solve it. I will update.

@@ -122,6 +122,16 @@ Other enhancements
Backwards incompatible API changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _whatsnew.api_breaking.io_compat

Pickle and HDF5 compat requires >= 0.13.0
Copy link
Member

Choose a reason for hiding this comment

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

This title is not fully clear. I would at least add 'requires pandas >= 0.13.0'. But you mean that pickle and HDF5 files created with pandas versions older than 0.13.0 may not be readable anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no the issue is that if a TimeSeries is used it won't work (and that's why I deleted the pickle files < 0.13.0). To be honest I don't have a problem with just saying we are pickle back-compat to >= 0.13.

It still will work if TimeSeries is not present though.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that is what I thought, but the title makes that not very clear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see my update on the doc if any more clear.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's certainly better!
My comment here was mainly about the title (which people scan, so it would be nice if this is clear). The too long version would be something like "Reading pickle and HDF5 files requires them being saved with pandas >= 0.13" or "Possible incompatibility with pickle and HDF5 files created with pandas < 0.13.0", but thinking on more condensed version but that is still clear

@jorisvandenbossche
Copy link
Member

Hmm, the statsmodels import is crashing on this ..
https://travis-ci.org/pandas-dev/pandas/jobs/190645844

And seems this is already fixed on master (statsmodels/statsmodels#2807), but AFAIK not yet in a released version of statsmodels.

@jreback
Copy link
Contributor Author

jreback commented Jan 10, 2017

@jorisvandenbossche on statsmodels. hmm, I think 0.8.0 will be out before we release 0.20.0, so this is mitigated. But this has been deprecated for quite a long time (and they haven't done releases in a while).

cc @josef-pkt

@jorisvandenbossche
Copy link
Member

0.17 was released in October 2015, and they removed it in Feb 2016, so they were not that much behind :-)
It's indeed just a problem they didn't have a release for some time, but the problem is also that, although we think/hope it will be, we are not 100% sure statsmodels 0.8 will be released before pandas 0.20

was used. If you find yourself in this situation. You can use a recent prior version of pandas to read in
your pickle / HDF5 files, then write them out again after applying the procedure below.

.. code-block:: ipython
Copy link
Member

Choose a reason for hiding this comment

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

this should have no indentation

@jreback
Copy link
Contributor Author

jreback commented Jan 11, 2017

@jorisvandenbossche

@jorisvandenbossche
Copy link
Member

The PR is certainly fine for me, but I think merging now is possibly a bit problematic. As all users of pandas master that also use statsmodels (or eg seaborn which uses statsmodels for certain functionality) will get import errors. Not sure how many people it would impact though.
Maybe wait until a reaction of statsmodels on their envisioned timeline for a release?

@jreback
Copy link
Contributor Author

jreback commented Jan 11, 2017

@jorisvandenbossche that's fair, will leave it for now then.

@jreback jreback force-pushed the time_series branch 3 times, most recently from 680f964 to 56080ee Compare February 9, 2017 00:51
@jreback
Copy link
Contributor Author

jreback commented Feb 9, 2017

ok, seems statsmodels 0.8.0 is out (I put our 2.7 build on it via pip install).

So this all checks out and everything runs with this PR (of course deprecation warnings for .ix, but that is another matter).

@jreback jreback force-pushed the time_series branch 3 times, most recently from 194b5c6 to 780a92c Compare February 12, 2017 17:39
@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

@jorisvandenbossche any more comments here?

@jorisvandenbossche
Copy link
Member

Just to come back on the legacy pickles you removed. I tried to read those with this branch, and only half of them contain a TimeSeries (and thus fail, it are the 0.12 ones and the 0.11.0_x86_64_linux_3.3.0.pickle one).
Shouldn't we just keep the other ones as tests until we have a more pressing issue to declare we don't read in pickles < 0.13 ? They are currently working, so I don't see a reason to remove them

@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

@jorisvandenbossche

used my new renaming feature in pickle_compat :>

87804b4

so these are read/converted just fine. Still I think we should 'drop' compat with < 0.13 anyhow. Its about time.

@jorisvandenbossche
Copy link
Member

That also means that the whatsnew notice can be largely (the part on pickle compat) removed?

@jorisvandenbossche
Copy link
Member

Let's have a separate issue about pickle compat. I don't really object dropping older versions, but as long it is not that much of effort to keep it (but I don't know how much effort you have to do in other cases to keep the compat), and we have tests that are passing, I also don't see a strong reason to drop it.

@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

@jorisvandenbossche yes, though I am +1 on saying we are no longer < 0.13 compat :)

@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

and this works for pickle. It doesn't for HDF5 (yes again may be able to fix it, but that's harder).

@jorisvandenbossche
Copy link
Member

though I am +1 on saying we are no longer < 0.13 compat :)

OK, but that should not be tied to TimeSeries depr (in the whatsnew explanation)

@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

see my prior (so I will revert on the pickle compat in whatsnew).

xref pandas-dev#10890

DEPR: remove Series.is_time_series in favor of Series.index.is_all_dates
@jorisvandenbossche
Copy link
Member

Yep, just saw it, fine!

@jreback
Copy link
Contributor Author

jreback commented Feb 27, 2017

ok, lmk if you have any other comments. will merge on green.

@jreback jreback closed this in dd368eb Feb 28, 2017
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
xref pandas-dev#10890

Author: Jeff Reback <[email protected]>

Closes pandas-dev#15098 from jreback/time_series and squashes the following commits:

d9101bc [Jeff Reback] fix back-compat for < 0.13
ed57bd5 [Jeff Reback] DEPR: remove legacy pd.TimeSeries class in favor of pd.Series
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants