Skip to content

DOC: Clarify deprecation of freq for Timestamp #49501

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

Closed
wants to merge 2 commits into from
Closed
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
12 changes: 12 additions & 0 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,12 @@ class Timestamp(_Timestamp):
nanosecond : int, optional, default 0
freq : str, DateOffset
Offset which Timestamp will have.

.. deprecated:: 1.3.0

The freq parameter of a Timestamp is deprecated and will be
removed in a future version.

tz : str, pytz.timezone, dateutil.tz.tzfile or None
Time zone for time which Timestamp will have.
unit : str
Expand Down Expand Up @@ -1311,6 +1317,12 @@ class Timestamp(_Timestamp):
Date corresponding to a proleptic Gregorian ordinal.
freq : str, DateOffset
Offset to apply to the Timestamp.

.. deprecated:: 1.3.0

The freq parameter of a Timestamp is deprecated and will be
removed in a future version.

tz : str, pytz.timezone, dateutil.tz.tzfile or None
Time zone for the Timestamp.

Expand Down
5 changes: 3 additions & 2 deletions pandas/tests/scalar/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ def test_nat_doc_strings(compare):
klass, method = compare
klass_doc = getattr(klass, method).__doc__

# Ignore differences with Timestamp.isoformat() as they're intentional
if klass == Timestamp and method == "isoformat":
# Ignore differences with Timestamp.isoformat() and Timestamp.fromordinal()
# as they're intentional
if klass == Timestamp and method in ("isoformat", "fromordinal"):
return

if method == "to_numpy":
Expand Down