DEPR: remove pd.TimeSeries & Series.is_time_series by jreback · Pull Request #15098 · pandas-dev/pandas (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@jreback

This was referenced

Jan 10, 2017

@codecov-io

jorisvandenbossche

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).

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)

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.

.. _whatsnew.api_breaking.io_compat
Pickle and HDF5 compat requires >= 0.13.0

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?

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.

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

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.

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

@jreback

@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

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

jorisvandenbossche

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

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

@jorisvandenbossche

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

@jreback

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

@jorisvandenbossche

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

@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

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

@jorisvandenbossche

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

@jreback

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

@jorisvandenbossche

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

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

@jreback

xref pandas-dev#10890

DEPR: remove Series.is_time_series in favor of Series.index.is_all_dates

@jorisvandenbossche

@jreback

@jreback

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

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request

Mar 21, 2017

@jreback @AnkurDedania

xref pandas-dev#10890

Author: Jeff Reback jeff@reback.net

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

Labels