Skip to content

Commit 646a60f

Browse files
committed
MAINT: Merge main
2 parents 49734ca + 8fb0a9b commit 646a60f

27 files changed

+831
-781
lines changed

pandas-stubs/_testing/__init__.pyi

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from typing import Literal
1+
from contextlib import contextmanager
2+
from typing import (
3+
Any,
4+
Generator,
5+
Literal,
6+
)
27

38
from pandas import (
49
DataFrame,
@@ -107,3 +112,7 @@ def assert_produces_warning(
107112
check_stacklevel: bool = ...,
108113
raise_on_extra_warnings: bool = ...,
109114
) -> None: ...
115+
@contextmanager
116+
def ensure_clean(
117+
filename: str | None = ..., return_filelike: bool = ..., **kwargs: Any
118+
) -> Generator[str, None, None]: ...

pandas-stubs/_typing.pyi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,12 @@ StataDateFormat = Literal[
220220
"%ty",
221221
]
222222

223+
FillnaOptions = Literal["backfill", "bfill", "ffill", "pad"]
224+
ReplaceMethod = Literal["pad", "ffill", "bfill"]
225+
SortKind = Literal["quicksort", "mergesort", "heapsort", "stable"]
226+
NaPosition = Literal["first", "last"]
227+
MergeHow = Literal["left", "right", "outer", "inner"]
228+
JsonOrient = Literal["split", "records", "index", "columns", "values", "table"]
229+
TimestampConvention = Literal["start", "end", "s", "e"]
230+
223231
__all__ = ["npt", "type_t"]

pandas-stubs/_version.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ version_json: str = ...
44

55
def get_versions(): ...
66

7-
_stub_version = Literal["1.4.3.220815"]
7+
_stub_version = Literal["1.4.3.220822"]

pandas-stubs/core/base.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ from pandas.core.arrays import ExtensionArray
1010
from pandas.core.arrays.categorical import Categorical
1111

1212
from pandas._typing import (
13+
NaPosition,
1314
NDFrameT,
1415
SeriesAxisType,
1516
)
@@ -75,7 +76,9 @@ class IndexOpsMixin:
7576
def factorize(
7677
self, sort: bool = ..., na_sentinel: int = ...
7778
) -> tuple[np.ndarray, np.ndarray | Index | Categorical]: ...
78-
def searchsorted(self, value, side: str = ..., sorter=...) -> int | list[int]: ...
79+
def searchsorted(
80+
self, value, side: Literal["left", "right"] = ..., sorter=...
81+
) -> int | list[int]: ...
7982
def drop_duplicates(
80-
self, keep: Literal["first", "last", False] = ...
83+
self, keep: NaPosition | Literal[False] = ...
8184
) -> IndexOpsMixin: ...

0 commit comments

Comments
 (0)