Skip to content
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

BUG: Breaking change to offsets.pyx - quarter offset classes #39890

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d4428da
Breaking change to offsets.pyx
Pawel-Kranzberg Feb 18, 2021
a546ddc
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
d564763
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
85ee259
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
8b4ed54
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
6e1f3c5
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
01ce09f
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
b95cc70
Update test_constructors.py
Pawel-Kranzberg Feb 20, 2021
ccb9b97
Update test_misc.py
Pawel-Kranzberg Feb 20, 2021
f1204de
Update test_period_index.py
Pawel-Kranzberg Feb 20, 2021
a8c8a3d
Update offsets.pyx
Pawel-Kranzberg Feb 20, 2021
1338c1f
Update test_dst.py
Pawel-Kranzberg Feb 20, 2021
d7c8cad
Update test_dst.py
Pawel-Kranzberg Feb 20, 2021
3399d67
Update test_offsets.py
Pawel-Kranzberg Feb 20, 2021
79fe747
Update test_offsets.py
Pawel-Kranzberg Feb 20, 2021
2f456cb
Update test_constructors.py
Pawel-Kranzberg Feb 20, 2021
3fd9a64
Update test_misc.py
Pawel-Kranzberg Feb 20, 2021
3ce1de9
Update test_offsets.py
Pawel-Kranzberg Feb 20, 2021
7e1e5d2
Update test_yqm_offsets.py
Pawel-Kranzberg Feb 20, 2021
f9e7c3b
Update test_period_index.py
Pawel-Kranzberg Feb 20, 2021
27a24ba
Update test_offsets.py
Pawel-Kranzberg Feb 20, 2021
197fa1b
Update test_offsets.py
Pawel-Kranzberg Feb 20, 2021
8154be9
Rename startingMonth to month
Pawel-Kranzberg Mar 17, 2021
24afb65
Merge branch 'master' into patch-2
Pawel-Kranzberg Mar 17, 2021
2757983
Update test_to_offset.py
Pawel-Kranzberg Mar 17, 2021
dc55ee6
Update test_libfrequencies.py
Pawel-Kranzberg Mar 17, 2021
12cf5bf
Update test_period.py
Pawel-Kranzberg Mar 18, 2021
8b91c5c
Update offsets.pyx
Pawel-Kranzberg Mar 18, 2021
9b4f609
Remove startingMonth reference
Pawel-Kranzberg Mar 18, 2021
d1099a8
Rename startingMonth to month
Pawel-Kranzberg Mar 18, 2021
8892734
Update offset_frequency.rst
Pawel-Kranzberg Mar 18, 2021
1cde76e
DOC: Rename startingMonth to month
Pawel-Kranzberg Mar 18, 2021
4e659a5
Rename startingMonth to month
Pawel-Kranzberg Mar 18, 2021
36df0f7
Fix "QuarterBegin" timestamp in test_rollback
Pawel-Kranzberg Mar 18, 2021
1ec3a9b
Fix timestamp for QuarterBegin
Pawel-Kranzberg Mar 18, 2021
1a6bf2c
Fix offsets tests for QuarterBegin
Pawel-Kranzberg Mar 19, 2021
a8e47a4
Rename startingMonth to month
Pawel-Kranzberg Mar 19, 2021
cbce0bd
Fix pickling of quarter-based offsets
Pawel-Kranzberg Mar 19, 2021
9506ee0
Fix pickling of quarter-based offsets
Pawel-Kranzberg Mar 19, 2021
6a7b0db
Deprecate startingMonth
Pawel-Kranzberg Mar 19, 2021
bafe9d2
Merge pull request #3 from pandas-dev/master
Pawel-Kranzberg Mar 30, 2021
e5ad2ac
Add deprecation warning test
Pawel-Kranzberg Mar 30, 2021
66d37b5
Add test_startingMonth_deprecation_warning
Pawel-Kranzberg Mar 30, 2021
57fe350
Add startingMonth deprecation to QuarterEnd
Pawel-Kranzberg Mar 30, 2021
e2665e0
Fix linting
Pawel-Kranzberg Mar 30, 2021
94947d4
Add startingMonth deprecation to QuarterEnd
Pawel-Kranzberg Mar 30, 2021
30ad2ff
startingMonth depreciation fix
Pawel-Kranzberg Mar 30, 2021
9621c16
Update offsets.pyx
Pawel-Kranzberg Mar 30, 2021
b9d6383
Update offsets.pyx
Pawel-Kranzberg Mar 31, 2021
5b89343
Create QuarterBase docstring
Pawel-Kranzberg Mar 31, 2021
6208287
Update docstrings for quarter-based offsets
Pawel-Kranzberg Mar 31, 2021
ace4503
Update v0.18.0.rst
Pawel-Kranzberg Mar 31, 2021
63a1152
Update offset_frequency.rst
Pawel-Kranzberg Mar 31, 2021
f2410e7
Update docstrings
Pawel-Kranzberg Mar 31, 2021
bc0d0c6
whatsnew entry
Pawel-Kranzberg Mar 31, 2021
f21921d
Update offsets.pyx according to GH#39890 review
Pawel-Kranzberg Apr 5, 2021
448e0da
Update test_offsets.pyx according to GH#39890 review
Pawel-Kranzberg Apr 5, 2021
fe07ea2
Update offsets.pyx
Pawel-Kranzberg Apr 5, 2021
5b2ec3f
Update offsets.pyx
Pawel-Kranzberg Apr 5, 2021
827ab65
Update v1.3.0.rst
Pawel-Kranzberg Apr 5, 2021
f27b5ef
Update offsets.pyx
Pawel-Kranzberg Apr 5, 2021
1441a29
Update v1.3.0.rst
Pawel-Kranzberg Apr 5, 2021
7875614
Update offset_frequency.rst
Pawel-Kranzberg Apr 6, 2021
688eaf6
Update v0.18.0.rst
Pawel-Kranzberg Apr 6, 2021
c0f6d84
Update v1.3.0.rst
Pawel-Kranzberg Apr 6, 2021
a5416a1
Update v0.18.0.rst
Pawel-Kranzberg Apr 6, 2021
1d3d45d
Merge branch 'master' into patch-2
Pawel-Kranzberg Apr 14, 2021
22c779f
Update v1.3.0.rst
Pawel-Kranzberg May 6, 2021
384cb82
Update offsets.pyx
Pawel-Kranzberg May 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/source/reference/offset_frequency.rst
Expand Up @@ -655,7 +655,7 @@ Properties
BQuarterEnd.normalize
BQuarterEnd.rule_code
BQuarterEnd.n
BQuarterEnd.startingMonth
BQuarterEnd.month

Methods
~~~~~~~
Expand Down Expand Up @@ -690,7 +690,7 @@ Properties
BQuarterBegin.normalize
BQuarterBegin.rule_code
BQuarterBegin.n
BQuarterBegin.startingMonth
BQuarterBegin.month

Methods
~~~~~~~
Expand Down Expand Up @@ -725,7 +725,7 @@ Properties
QuarterEnd.normalize
QuarterEnd.rule_code
QuarterEnd.n
QuarterEnd.startingMonth
QuarterEnd.month

Methods
~~~~~~~
Expand Down Expand Up @@ -760,7 +760,7 @@ Properties
QuarterBegin.normalize
QuarterBegin.rule_code
QuarterBegin.n
QuarterBegin.startingMonth
QuarterBegin.month

Methods
~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.18.0.rst
Expand Up @@ -686,6 +686,7 @@ when it is an anchor point (e.g., a quarter start date), and otherwise roll
forward to the next anchor point.

.. ipython:: python
:okwarning:

d = pd.Timestamp('2014-02-01')
d
Expand All @@ -706,6 +707,7 @@ This behavior has been corrected in version 0.18.0, which is consistent with
other anchored offsets like ``MonthBegin`` and ``YearBegin``.

.. ipython:: python
:okwarning:

d = pd.Timestamp('2014-02-15')
d + pd.offsets.QuarterBegin(n=0, startingMonth=2)
Expand Down
32 changes: 32 additions & 0 deletions doc/source/whatsnew/v1.3.0.rst
Expand Up @@ -458,6 +458,36 @@ with a :class:`MultiIndex` in the result. This can lead to a perceived duplicati
df.groupby('label1').rolling(1).sum()


.. _whatsnew_130.notable_bug_fixes.quarterbegin_default_anchor:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to say deprecation about the startingMonth as its mentioned below as well. I would prefer making these 2 distinct and unrelated changes (which they are). so don't mention deprecation at all here.


Changed default periods in :class:`~pandas.tseries.offsets.QuarterBegin` and :class:`~pandas.tseries.offsets.BQuarterBegin`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be the same length as the title, it should error if not

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quarter-based time offset classes :class:`~pandas.tseries.offsets.QuarterEnd`,
:class:`~pandas.tseries.offsets.QuarterBegin`, :class:`~pandas.tseries.offsets.BQuarterEnd`,
:class:`~pandas.tseries.offsets.BQuarterBegin` now use ``month`` instead of ``startingMonth``
as a time anchor parameter (:issue:`5307`). The default value for :class:`~pandas.tseries.offsets.QuarterBegin`
and :class:`~pandas.tseries.offsets.BQuarterBegin` is now 1 (January) instead of 3 (March),
as a result these offsets are aligned with standard calendar quarters (:issue:`8435`).

*pandas 1.2.x*

.. code-block:: ipython

In [1]: pd.Timestamp(2014, 10, 10) + pd.tseries.offsets.QuarterBegin()
Out[2]: Timestamp('2014-12-01 00:00:00')
In [3]: pd.Timestamp(2014, 10, 10) + pd.tseries.offsets.BQuarterBegin()
Out[4]: Timestamp('2014-12-01 00:00:00')

*pandas 1.3.0*

.. code-block:: ipython
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use a code-block, rather an ipython block for the new behavior


In [1]: pd.Timestamp(2014, 10, 10) + pd.tseries.offsets.QuarterBegin()
Out[2]: Timestamp('2015-01-01 00:00:00')
In [3]: pd.Timestamp(2014, 10, 10) + pd.tseries.offsets.BQuarterBegin()
Out[4]: Timestamp('2015-01-01 00:00:00')

.. _whatsnew_130.api_breaking.deps:

Increased minimum versions for dependencies
Expand Down Expand Up @@ -570,6 +600,7 @@ Deprecations
- Deprecated allowing partial failure in :meth:`Series.transform` and :meth:`DataFrame.transform` when ``func`` is list-like or dict-like and raises anything but ``TypeError``; ``func`` raising anything but a ``TypeError`` will raise in a future version (:issue:`40211`)
- Deprecated support for ``np.ma.mrecords.MaskedRecords`` in the :class:`DataFrame` constructor, pass ``{name: data[name] for name in data.dtype.names}`` instead (:issue:`40363`)
- Deprecated the use of ``**kwargs`` in :class:`.ExcelWriter`; use the keyword argument ``engine_kwargs`` instead (:issue:`40430`)
- Deprecated the ``startingMonth`` keyword in quarter-based offsets :class:`QuarterBegin`, :class:`QuarterEnd`, :class:`BQuarterBegin`, :class:`BQuarterEnd`; use ``month`` instead (:issue:`5307`)
- Deprecated the ``level`` keyword for :class:`DataFrame` and :class:`Series` aggregations; use groupby instead (:issue:`39983`)

.. ---------------------------------------------------------------------------
Expand Down Expand Up @@ -625,6 +656,7 @@ Datetimelike
- Bug in :meth:`Timedelta.round`, :meth:`Timedelta.floor`, :meth:`Timedelta.ceil` for values near the implementation bounds of :class:`Timedelta` (:issue:`38964`)
- Bug in :func:`date_range` incorrectly creating :class:`DatetimeIndex` containing ``NaT`` instead of raising ``OutOfBoundsDatetime`` in corner cases (:issue:`24124`)
- Bug in :func:`infer_freq` incorrectly fails to infer 'H' frequency of :class:`DatetimeIndex` if the latter has a timezone and crosses DST boundaries (:issue:`39556`)
- Bug in offsets :class:`QuarterBegin` and :class:`BQuarterBegin` returning days that are not conventional quarter beginnings (:issue:`8435`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this a duplicate of the above section?


Timedelta
^^^^^^^^^
Expand Down