Skip to content

DEPR/CLN: remove SparseTimeSeries class (follow-up GH15098) #15567

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.20.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ Removal of prior version deprecations/changes
Similar functionality can be found in the `Google2Pandas <https://github.com/panalysis/Google2Pandas>`__ package.
- ``pd.to_datetime`` and ``pd.to_timedelta`` have dropped the ``coerce`` parameter in favor of ``errors`` (:issue:`13602`)
- ``pandas.stats.fama_macbeth``, ``pandas.stats.ols``, ``pandas.stats.plm`` and ``pandas.stats.var``, as well as the top-level ``pandas.fama_macbeth`` and ``pandas.ols`` routines are removed. Similar functionaility can be found in the `statsmodels <shttp://www.statsmodels.org/dev/>`__ package. (:issue:`11898`)
- The ``TimeSeries`` and ``SparseTimeSeries`` classes, aliases of ``Series``
and ``SparseSeries``, are removed (:issue:`10890`, :issue:`15098`).
- ``Series.is_time_series`` is dropped in favor of ``Series.index.is_all_dates`` (:issue:``)
- The deprecated ``irow``, ``icol``, ``iget`` and ``iget_value`` methods are removed
in favor of ``iloc`` and ``iat`` as explained :ref:`here <whatsnew_0170.deprecations>` (:issue:`10711`).
Expand Down
3 changes: 2 additions & 1 deletion pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def load_reduce(self):
('pandas.core.base', 'FrozenList'): ('pandas.indexes.frozen', 'FrozenList'),

# 10890
('pandas.core.series', 'TimeSeries'): ('pandas.core.series', 'Series')
('pandas.core.series', 'TimeSeries'): ('pandas.core.series', 'Series'),
('pandas.sparse.series', 'SparseTimeSeries'): ('pandas.sparse.series', 'SparseSeries')
}


Expand Down
2 changes: 1 addition & 1 deletion pandas/sparse/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# flake8: noqa
from pandas.sparse.array import SparseArray
from pandas.sparse.list import SparseList
from pandas.sparse.series import SparseSeries, SparseTimeSeries
from pandas.sparse.series import SparseSeries
from pandas.sparse.frame import SparseDataFrame
11 changes: 0 additions & 11 deletions pandas/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,14 +844,3 @@ def from_coo(cls, A, dense_index=False):
comp_method=_arith_method,
bool_method=None, use_numexpr=False,
force=True)


# backwards compatiblity
class SparseTimeSeries(SparseSeries):

def __init__(self, *args, **kwargs):
# deprecation TimeSeries, #10890
warnings.warn("SparseTimeSeries is deprecated. Please use "
"SparseSeries", FutureWarning, stacklevel=2)

super(SparseTimeSeries, self).__init__(*args, **kwargs)
3 changes: 1 addition & 2 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ class TestPDApi(Base, tm.TestCase):
'TimedeltaIndex', 'Timestamp']

# these are already deprecated; awaiting removal
deprecated_classes = ['WidePanel',
'SparseTimeSeries', 'Panel4D',
deprecated_classes = ['WidePanel', 'Panel4D',
'SparseList', 'Expr', 'Term']

# these should be deprecated in the future
Expand Down
6 changes: 0 additions & 6 deletions pandas/tests/sparse/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ def test_iteration_and_str(self):
[x for x in self.bseries]
str(self.bseries)

def test_TimeSeries_deprecation(self):

# deprecation TimeSeries, #10890
with tm.assert_produces_warning(FutureWarning):
pd.SparseTimeSeries(1, index=pd.date_range('20130101', periods=3))

def test_construct_DataFrame_with_sp_series(self):
# it works!
df = DataFrame({'col': self.bseries})
Expand Down