From e5fcd2b66e4ef59bd5828e93eebc7ae48b90ea44 Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Sat, 30 Nov 2024 10:20:07 -0500 Subject: [PATCH 1/2] GH1063 Remove deprecated methods --- pandas-stubs/core/resample.pyi | 46 +++++++++++----------------------- pandas-stubs/io/stata.pyi | 1 - 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/pandas-stubs/core/resample.pyi b/pandas-stubs/core/resample.pyi index dcc895f0e..2c4cc513f 100644 --- a/pandas-stubs/core/resample.pyi +++ b/pandas-stubs/core/resample.pyi @@ -122,40 +122,22 @@ class Resampler(BaseGroupBy[NDFrameT]): **kwargs, ) -> NDFrameT: ... def asfreq(self, fill_value: Scalar | None = ...) -> NDFrameT: ... - def sum( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def prod( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def min( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def max( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def first( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def last( - self, numeric_only: bool = ..., min_count: int = ..., *args, **kwargs - ) -> NDFrameT: ... - def median(self, numeric_only: bool = ..., *args, **kwargs) -> NDFrameT: ... - def mean(self, numeric_only: bool = ..., *args, **kwargs) -> NDFrameT: ... - def std( - self, ddof: int = ..., numeric_only: bool = ..., *args, **kwargs - ) -> NDFrameT: ... - def var( - self, ddof: int = ..., numeric_only: bool = ..., *args, **kwargs - ) -> NDFrameT: ... - def sem( - self, ddof: int = ..., numeric_only: bool = ..., *args, **kwargs - ) -> NDFrameT: ... - def ohlc(self, *args, **kwargs) -> DataFrame: ... + def sum(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def prod(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def min(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def max(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def first(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def last(self, numeric_only: bool = ..., min_count: int = ...) -> NDFrameT: ... + def median(self, numeric_only: bool = ...) -> NDFrameT: ... + def mean(self, numeric_only: bool = ...) -> NDFrameT: ... + def std(self, ddof: int = ..., numeric_only: bool = ...) -> NDFrameT: ... + def var(self, ddof: int = ..., numeric_only: bool = ...) -> NDFrameT: ... + def sem(self, ddof: int = ..., numeric_only: bool = ...) -> NDFrameT: ... + def ohlc(self) -> DataFrame: ... @overload - def nunique(self: Resampler[Series], *args, **kwargs) -> Series[int]: ... + def nunique(self: Resampler[Series]) -> Series[int]: ... @overload - def nunique(self: Resampler[DataFrame], *args, **kwargs) -> DataFrame: ... + def nunique(self: Resampler[DataFrame]) -> DataFrame: ... def size(self) -> Series[int]: ... @overload def count(self: Resampler[Series]) -> Series[int]: ... diff --git a/pandas-stubs/io/stata.pyi b/pandas-stubs/io/stata.pyi index 63c1daa9b..17f1e5bb9 100644 --- a/pandas-stubs/io/stata.pyi +++ b/pandas-stubs/io/stata.pyi @@ -100,7 +100,6 @@ class StataReader(StataParser, abc.Iterator): exc_value: BaseException | None, traceback: TracebackType | None, ) -> None: ... - def close(self) -> None: ... def __next__(self) -> DataFrame: ... def get_chunk(self, size: int | None = ...) -> DataFrame: ... def read( From c3cb2a0a5f3d7e782ca3bc1d1071c950d4d3e63e Mon Sep 17 00:00:00 2001 From: Loic Diridollou Date: Sat, 30 Nov 2024 10:31:54 -0500 Subject: [PATCH 2/2] GH1063 Remove infer_datetime_format from read_csv and to_datetime --- pandas-stubs/core/tools/datetimes.pyi | 4 ---- pandas-stubs/io/parsers/readers.pyi | 3 --- 2 files changed, 7 deletions(-) diff --git a/pandas-stubs/core/tools/datetimes.pyi b/pandas-stubs/core/tools/datetimes.pyi index 2ee995f1b..9210d4bd9 100644 --- a/pandas-stubs/core/tools/datetimes.pyi +++ b/pandas-stubs/core/tools/datetimes.pyi @@ -47,7 +47,6 @@ def to_datetime( format: str | None = ..., exact: bool = ..., unit: str | None = ..., - infer_datetime_format: bool = ..., origin: Literal["julian", "unix"] | TimestampConvertibleTypes = ..., cache: bool = ..., ) -> Timestamp: ... @@ -61,7 +60,6 @@ def to_datetime( format: str | None = ..., exact: bool = ..., unit: str | None = ..., - infer_datetime_format: bool = ..., origin: Literal["julian", "unix"] | TimestampConvertibleTypes = ..., cache: bool = ..., ) -> Timestamp | NaTType: ... @@ -75,7 +73,6 @@ def to_datetime( format: str | None = ..., exact: bool = ..., unit: str | None = ..., - infer_datetime_format: bool = ..., origin: Literal["julian", "unix"] | TimestampConvertibleTypes = ..., cache: bool = ..., ) -> TimestampSeries: ... @@ -98,7 +95,6 @@ def to_datetime( format: str | None = ..., exact: bool = ..., unit: str | None = ..., - infer_datetime_format: bool = ..., origin: Literal["julian", "unix"] | TimestampConvertibleTypes = ..., cache: bool = ..., ) -> DatetimeIndex: ... diff --git a/pandas-stubs/io/parsers/readers.pyi b/pandas-stubs/io/parsers/readers.pyi index 93b88fc81..691b56fea 100644 --- a/pandas-stubs/io/parsers/readers.pyi +++ b/pandas-stubs/io/parsers/readers.pyi @@ -71,7 +71,6 @@ def read_csv( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] ) = ..., - infer_datetime_format: bool = ..., keep_date_col: bool = ..., date_format: dict[Hashable, str] | str | None = ..., dayfirst: bool = ..., @@ -136,7 +135,6 @@ def read_csv( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] ) = ..., - infer_datetime_format: bool = ..., keep_date_col: bool = ..., date_format: dict[Hashable, str] | str | None = ..., dayfirst: bool = ..., @@ -201,7 +199,6 @@ def read_csv( | Sequence[Sequence[int]] | Mapping[str, Sequence[int | str]] ) = ..., - infer_datetime_format: bool = ..., keep_date_col: bool = ..., date_format: dict[Hashable, str] | str | None = ..., dayfirst: bool = ...,