Skip to content

Commit 4cbf70d

Browse files
committed
review updates 2
1 parent 3d58a51 commit 4cbf70d

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

doc/source/timeseries.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,14 @@ of those specified will not be generated:
399399
Custom Frequency Ranges
400400
~~~~~~~~~~~~~~~~~~~~~~~
401401

402+
.. warning::
403+
404+
This functionality was originally exclusive to ``cdate_range``, which is
405+
deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that
406+
``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters
407+
when custom business day, 'C', is passed as the frequency string. Support has
408+
been expanded with ``bdate_range`` to work with any custom frequency string.
409+
402410
.. versionadded:: 0.21.0
403411

404412
``bdate_range`` can also generate a range of custom frequency dates by using
@@ -415,14 +423,6 @@ used if a custom frequency string is passed.
415423
416424
pd.bdate_range(start, end, freq='CBMS', weekmask=weekmask)
417425
418-
.. warning::
419-
420-
This functionality was originally exclusive to ``cdate_range``, which is
421-
deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that
422-
``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters
423-
when custom business day, 'C', is passed as the frequency string. Support has
424-
been expanded with ``bdate_range`` to work with any custom frequency string.
425-
426426
.. seealso::
427427

428428
:ref:`timeseries.custombusinessdays`

pandas/tests/api/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,13 @@ def test_deprecation_access_func(self):
240240
[c1, c2],
241241
sort_categories=True,
242242
ignore_order=True)
243+
244+
245+
class TestCDateRange(object):
246+
247+
def test_deprecation_cdaterange(self):
248+
# GH17596
249+
from pandas.core.indexes.datetimes import cdate_range
250+
with tm.assert_produces_warning(FutureWarning,
251+
check_stacklevel=False):
252+
cdate_range('2017-01-01', '2017-12-31')

pandas/tests/indexes/datetimes/test_date_range.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import pandas as pd
1212
import pandas.util.testing as tm
1313
from pandas import compat
14-
from pandas.core.indexes.datetimes import cdate_range
1514
from pandas import date_range, bdate_range, offsets, DatetimeIndex, Timestamp
1615
from pandas.tseries.offsets import (generate_range, CDay, BDay, DateOffset,
1716
MonthEnd, prefix_mapping)
@@ -634,8 +633,3 @@ def test_all_custom_freq(self, freq):
634633
msg = 'invalid custom frequency string: {freq}'
635634
with tm.assert_raises_regex(ValueError, msg.format(freq=bad_freq)):
636635
bdate_range(START, END, freq=bad_freq)
637-
638-
def test_deprecation_cdaterange(self):
639-
# GH17596
640-
with tm.assert_produces_warning(FutureWarning):
641-
cdate_range(START, END)

0 commit comments

Comments
 (0)