diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi index 15edfa047..b9a479c0d 100644 --- a/pandas-stubs/core/frame.pyi +++ b/pandas-stubs/core/frame.pyi @@ -730,24 +730,9 @@ class DataFrame(NDFrame, OpsMixin): | list[HashableT], drop: _bool = ..., append: _bool = ..., - *, verify_integrity: _bool = ..., ) -> DataFrame: ... @overload - def set_index( - self, - keys: Label - | Series - | Index - | np.ndarray - | Iterator[HashableT] - | list[HashableT], - drop: _bool = ..., - append: _bool = ..., - inplace: _bool | None = ..., - verify_integrity: _bool = ..., - ) -> DataFrame | None: ... - @overload def reset_index( self, level: Level | Sequence[Level] = ..., diff --git a/pandas-stubs/io/stata.pyi b/pandas-stubs/io/stata.pyi index fb3c7bd48..d2ff3f130 100644 --- a/pandas-stubs/io/stata.pyi +++ b/pandas-stubs/io/stata.pyi @@ -25,7 +25,7 @@ from pandas._typing import ( @overload def read_stata( - path: FilePath | ReadBuffer[bytes], + filepath_or_buffer: FilePath | ReadBuffer[bytes], *, convert_dates: bool = ..., convert_categoricals: bool = ..., @@ -41,15 +41,15 @@ def read_stata( ) -> StataReader: ... @overload def read_stata( - path: FilePath | ReadBuffer[bytes], + filepath_or_buffer: FilePath | ReadBuffer[bytes], *, - convert_dates: bool, - convert_categoricals: bool, - index_col: str | None, - convert_missing: bool, - preserve_dtypes: bool, - columns: list[HashableT] | None, - order_categoricals: bool, + convert_dates: bool = ..., + convert_categoricals: bool = ..., + index_col: str | None = ..., + convert_missing: bool = ..., + preserve_dtypes: bool = ..., + columns: list[HashableT] | None = ..., + order_categoricals: bool = ..., chunksize: int, iterator: bool = ..., compression: CompressionOptions = ..., @@ -57,7 +57,7 @@ def read_stata( ) -> StataReader: ... @overload def read_stata( - path: FilePath | ReadBuffer[bytes], + filepath_or_buffer: FilePath | ReadBuffer[bytes], *, convert_dates: bool = ..., convert_categoricals: bool = ..., diff --git a/tests/test_io.py b/tests/test_io.py index fd37831ee..bf9484e07 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -196,6 +196,8 @@ def test_read_stata_iterator(): check( assert_type(read_stata(str_path, iterator=True), StataReader), StataReader ) + reader = read_stata(str_path, chunksize=1) + check(assert_type(reader, StataReader), StataReader) def test_clipboard(): diff --git a/tests/test_series.py b/tests/test_series.py index 2dcd786c4..d1ceca79e 100644 --- a/tests/test_series.py +++ b/tests/test_series.py @@ -266,6 +266,8 @@ def test_types_rank() -> None: s.rank(method="dense", ascending=True) with pytest.warns(FutureWarning, match="Calling Series.rank with numeric_only"): s.rank(method="first", numeric_only=True) + s2 = pd.Series([1, 1, 2, 5, 6, np.nan]) + s2.rank(method="first", numeric_only=True) def test_types_mean() -> None: