Skip to content

Commit 4a495d0

Browse files
committed
DEPR: remove legacy pd.TimeSeries class in favor of pd.Series
xref pandas-dev#10890
1 parent aa03e7f commit 4a495d0

15 files changed

+12
-29
lines changed

doc/source/whatsnew/v0.20.0.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ Other enhancements
122122
Backwards incompatible API changes
123123
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124124

125+
.. _whatsnew.api_breaking.io_compat
126+
127+
Pickle and HDF5 compat requires >= 0.13.0
128+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129+
130+
``pd.TimeSeries`` was deprecated officially in 0.17.0, though has only been an alias since 0.13.0. It has
131+
been dropped in favor of ``pd.Series``.
132+
133+
This *may* cause pickles / HDF5 files that were created with the ``pd.TimeSeries`` to become unreadable. (:issue:``).
134+
125135
.. _whatsnew.api_breaking.index_map
126136

127137
Map on Index types now return other Index types
@@ -273,7 +283,6 @@ Removal of prior version deprecations/changes
273283

274284

275285

276-
277286
.. _whatsnew_0200.performance:
278287

279288
Performance Improvements

pandas/api/tests/test_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TestPDApi(Base, tm.TestCase):
5959
'TimedeltaIndex', 'Timestamp']
6060

6161
# these are already deprecated; awaiting removal
62-
deprecated_classes = ['TimeSeries', 'WidePanel',
62+
deprecated_classes = ['WidePanel',
6363
'SparseTimeSeries', 'Panel4D',
6464
'SparseList']
6565

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pandas.core.index import (Index, CategoricalIndex, Int64Index,
1313
RangeIndex, Float64Index, MultiIndex)
1414

15-
from pandas.core.series import Series, TimeSeries
15+
from pandas.core.series import Series
1616
from pandas.core.frame import DataFrame
1717
from pandas.core.panel import Panel, WidePanel
1818
from pandas.core.panel4d import Panel4D

pandas/core/series.py

-9
Original file line numberDiff line numberDiff line change
@@ -2980,15 +2980,6 @@ def create_from_value(value, index, dtype):
29802980
return subarr
29812981

29822982

2983-
# backwards compatiblity
2984-
class TimeSeries(Series):
2985-
def __init__(self, *args, **kwargs):
2986-
# deprecation TimeSeries, #10890
2987-
warnings.warn("TimeSeries is deprecated. Please use Series",
2988-
FutureWarning, stacklevel=2)
2989-
2990-
super(TimeSeries, self).__init__(*args, **kwargs)
2991-
29922983
# ----------------------------------------------------------------------
29932984
# Add plotting methods to Series
29942985

pandas/io/pytables.py

-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ class DuplicateWarning(Warning):
164164

165165
Series: u('series'),
166166
SparseSeries: u('sparse_series'),
167-
pd.TimeSeries: u('series'),
168167
DataFrame: u('frame'),
169168
SparseDataFrame: u('sparse_frame'),
170169
Panel: u('wide'),
@@ -173,7 +172,6 @@ class DuplicateWarning(Warning):
173172

174173
# storer class map
175174
_STORER_MAP = {
176-
u('TimeSeries'): 'LegacySeriesFixed',
177175
u('Series'): 'LegacySeriesFixed',
178176
u('DataFrame'): 'LegacyFrameFixed',
179177
u('DataMatrix'): 'LegacyFrameFixed',
-14.6 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

pandas/io/tests/test_pytables.py

-9
Original file line numberDiff line numberDiff line change
@@ -4458,15 +4458,6 @@ def test_pytables_native2_read(self):
44584458
d1 = store['detector']
44594459
self.assertIsInstance(d1, DataFrame)
44604460

4461-
def test_legacy_read(self):
4462-
with ensure_clean_store(
4463-
tm.get_data_path('legacy_hdf/legacy.h5'),
4464-
mode='r') as store:
4465-
store['a']
4466-
store['b']
4467-
store['c']
4468-
store['d']
4469-
44704461
def test_legacy_table_read(self):
44714462
# legacy table types
44724463
with ensure_clean_store(

pandas/tests/series/test_constructors.py

-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ def test_scalar_conversion(self):
3838
self.assertEqual(int(Series([1.])), 1)
3939
self.assertEqual(long(Series([1.])), 1)
4040

41-
def test_TimeSeries_deprecation(self):
42-
43-
# deprecation TimeSeries, #10890
44-
with tm.assert_produces_warning(FutureWarning):
45-
pd.TimeSeries(1, index=date_range('20130101', periods=3))
46-
4741
def test_constructor(self):
4842
# Recognize TimeSeries
4943
with tm.assert_produces_warning(FutureWarning):

0 commit comments

Comments
 (0)