From 009bfdc4b045699f2f48966e49026de095028a57 Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Thu, 3 Nov 2022 16:20:11 +0000 Subject: [PATCH 1/2] DOC: Clarify deprecation of freq for Timestamp --- pandas/_libs/tslibs/timestamps.pyx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index f80cb2e27cc23..281c6f3a700eb 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -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 @@ -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. From 3a0611bdc280edf90c46d4088c5f076b4355a2db Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Thu, 3 Nov 2022 17:22:23 +0000 Subject: [PATCH 2/2] TST: Correct test --- pandas/tests/scalar/test_nat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/test_nat.py b/pandas/tests/scalar/test_nat.py index 79e9e1d4fc68b..1d3253f7fa551 100644 --- a/pandas/tests/scalar/test_nat.py +++ b/pandas/tests/scalar/test_nat.py @@ -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":