-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
69f9441
to
6adcf80
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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?)
doc/source/whatsnew/v0.20.0.txt
Outdated
``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). |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
doc/source/whatsnew/v0.20.0.txt
Outdated
@@ -122,6 +122,16 @@ Other enhancements | |||
Backwards incompatible API changes | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
.. _whatsnew.api_breaking.io_compat | |||
|
|||
Pickle and HDF5 compat requires >= 0.13.0 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Hmm, the And seems this is already fixed on master (statsmodels/statsmodels#2807), but AFAIK not yet in a released version of statsmodels. |
@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 |
0.17 was released in October 2015, and they removed it in Feb 2016, so they were not that much behind :-) |
doc/source/whatsnew/v0.20.0.txt
Outdated
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 |
There was a problem hiding this comment.
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
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. |
@jorisvandenbossche that's fair, will leave it for now then. |
680f964
to
56080ee
Compare
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 |
194b5c6
to
780a92c
Compare
@jorisvandenbossche any more comments here? |
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). |
used my new renaming feature in pickle_compat :> so these are read/converted just fine. Still I think we should 'drop' compat with < 0.13 anyhow. Its about time. |
That also means that the whatsnew notice can be largely (the part on pickle compat) removed? |
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. |
@jorisvandenbossche yes, though I am +1 on saying we are no longer < 0.13 compat :) |
and this works for pickle. It doesn't for HDF5 (yes again may be able to fix it, but that's harder). |
OK, but that should not be tied to TimeSeries depr (in the whatsnew explanation) |
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
Yep, just saw it, fine! |
ok, lmk if you have any other comments. will merge on green. |
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
xref #10890