From 4529b51dfd235b5ce9275b8c52adffb6ed252c01 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Sun, 1 Dec 2024 11:47:02 -0500 Subject: [PATCH] GH1065 timestamp freq argument and DataFrame/Series.mask (#1066) * GH1065 Timestamp freq argument removal * GH1065 Add details to type of other in mask * GH1065 Revert json * GH1065 Realign Timestamp args with pandas --- pandas-stubs/_libs/tslibs/timestamps.pyi | 11 +++-------- pandas-stubs/core/frame.pyi | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pandas-stubs/_libs/tslibs/timestamps.pyi b/pandas-stubs/_libs/tslibs/timestamps.pyi index 9df14b3d..504b801c 100644 --- a/pandas-stubs/_libs/tslibs/timestamps.pyi +++ b/pandas-stubs/_libs/tslibs/timestamps.pyi @@ -59,11 +59,6 @@ class Timestamp(datetime): def __new__( cls, ts_input: np.integer | float | str | _date | datetime | np.datetime64 = ..., - # Freq is deprecated but is left in to allow code like Timestamp(2000,1,1) - # Removing it would make the other arguments position only - freq: int | str | BaseOffset | None = ..., - tz: str | _tzinfo | int | None = ..., - unit: str | int | None = ..., year: int | None = ..., month: int | None = ..., day: int | None = ..., @@ -71,9 +66,11 @@ class Timestamp(datetime): minute: int | None = ..., second: int | None = ..., microsecond: int | None = ..., - nanosecond: int | None = ..., tzinfo: _tzinfo | None = ..., *, + nanosecond: int | None = ..., + tz: str | _tzinfo | int | None = ..., + unit: str | int | None = ..., fold: Literal[0, 1] | None = ..., ) -> Self: ... # GH 46171 @@ -119,8 +116,6 @@ class Timestamp(datetime): def fromordinal( cls, ordinal: int, - # freq produces a FutureWarning about being deprecated in a future version - freq: None = ..., tz: _tzinfo | str | None = ..., ) -> Self: ... @classmethod diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 57f1671e..7b5a8079 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -1955,7 +1955,7 @@ class DataFrame(NDFrame, OpsMixin): | Callable[[DataFrame], DataFrame] | Callable[[Any], _bool] ), - other=..., + other: Scalar | Series[S1] | DataFrame | Callable | NAType | None = ..., *, inplace: _bool = ..., axis: Axis | None = ...,