Skip to content

TYP: fix almost all keyword-only reported by stubtest #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ class Timestamp(datetime):
second: int | None = ...,
microsecond: int | None = ...,
tzinfo: _tzinfo | None = ...,
*,
fold: Literal[0, 1] | None = ...,
) -> Timestamp: ...
def astimezone(self: _DatetimeT, tz: _tzinfo | None = ...) -> _DatetimeT: ...
Expand Down
2 changes: 0 additions & 2 deletions pandas-stubs/core/algorithms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def unique(values: ExtensionArray) -> ExtensionArray: ...
def factorize(
values: Sequence,
sort: bool = ...,
# Not actually positional-only, used to handle deprecations in 1.5.0
*,
use_na_sentinel: bool = ...,
size_hint: int | None = ...,
) -> tuple[np.ndarray, np.ndarray]: ...
Expand Down
6 changes: 2 additions & 4 deletions pandas-stubs/core/arrays/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ class ExtensionArray:
) -> ABCExtensionArray: ...
def unique(self): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
# TODO: remove keyword-only when pandas removed na_sentinel
def factorize(
self,
# Not actually positional-only, used to handle deprecations in 1.5.0
*,
use_na_sentinel: bool = ...,
self, *, use_na_sentinel: bool = ...
) -> tuple[np.ndarray, ABCExtensionArray]: ...
def repeat(self, repeats, axis=...): ...
def take(
Expand Down
4 changes: 2 additions & 2 deletions pandas-stubs/core/arrays/boolean.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ class BooleanArray(BaseMaskedArray):
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs): ...
def __setitem__(self, key, value) -> None: ...
def astype(self, dtype, copy: bool = ...): ...
def any(self, skipna: bool = ..., **kwargs): ...
def all(self, skipna: bool = ..., **kwargs): ...
def any(self, *, skipna: bool = ..., **kwargs): ...
def all(self, *, skipna: bool = ..., **kwargs): ...
10 changes: 5 additions & 5 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,22 @@ class Categorical(ExtensionArray, PandasObject):
def dropna(self): ...
def value_counts(self, dropna: bool = ...): ...
def check_for_ordered(self, op) -> None: ...
def argsort(self, ascending: bool = ..., kind: str = ..., *args, **kwargs): ...
def argsort(self, *, ascending: bool = ..., kind: str = ..., **kwargs): ...
def sort_values(
self, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
self, *, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
): ...
def view(self, dtype=...): ...
def to_dense(self): ...
def fillna(self, value=..., method=..., limit=...): ...
def take(self, indexer, allow_fill: bool = ..., fill_value=...): ...
def take(self, indexer, *, allow_fill: bool = ..., fill_value=...): ...
def take_nd(self, indexer, allow_fill: bool = ..., fill_value=...): ...
def __len__(self) -> int: ...
def __iter__(self): ...
def __contains__(self, key) -> bool: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def min(self, skipna: bool = ...): ...
def max(self, skipna: bool = ...): ...
def min(self, *, skipna: bool = ...): ...
def max(self, *, skipna: bool = ...): ...
def mode(self, dropna: bool = ...): ...
def unique(self): ...
def equals(self, other): ...
Expand Down
8 changes: 4 additions & 4 deletions pandas-stubs/core/arrays/datetimelike.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
def astype(self, dtype, copy: bool = ...): ...
def view(self, dtype=...): ...
def unique(self): ...
def take(self, indices, allow_fill: bool = ..., fill_value=...): ...
def take(self, indices, *, allow_fill: bool = ..., fill_value=...): ...
def copy(self): ...
def shift(self, periods: int = ..., fill_value=..., axis: int = ...): ...
def searchsorted(self, value, side: str = ..., sorter=...): ...
Expand Down Expand Up @@ -77,8 +77,8 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
def __rsub__(self, other): ...
def __iadd__(self, other): ...
def __isub__(self, other): ...
def min(self, axis=..., skipna: bool = ..., *args, **kwargs): ...
def max(self, axis=..., skipna: bool = ..., *args, **kwargs): ...
def mean(self, skipna: bool = ...): ...
def min(self, *, axis=..., skipna: bool = ..., **kwargs): ...
def max(self, *, axis=..., skipna: bool = ..., **kwargs): ...
def mean(self, *, skipna: bool = ...): ...

def maybe_infer_freq(freq): ...
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/masked.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class BaseMaskedArray(ExtensionArray, ExtensionOpsMixin):
def isna(self): ...
@property
def nbytes(self) -> int: ...
def take(self, indexer, allow_fill: bool = ..., fill_value=...): ...
def take(self, indexer, *, allow_fill: bool = ..., fill_value=...): ...
def copy(self): ...
def value_counts(self, dropna: bool = ...): ...
8 changes: 2 additions & 6 deletions pandas-stubs/core/arrays/sparse/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,11 @@ class SparseArray(PandasObject, ExtensionArray, ExtensionOpsMixin):
def shift(self, periods: int = ..., fill_value=...): ...
def unique(self): ...
def factorize( # type: ignore[override]
self,
na_sentinel: int = ...,
# Not actually positional-only, used to handle deprecations in 1.5.0
*,
use_na_sentinel: bool = ...,
self, na_sentinel: int = ..., use_na_sentinel: bool = ...
) -> tuple[np.ndarray, SparseArray]: ...
def value_counts(self, dropna: bool = ...): ...
def __getitem__(self, key): ...
def take(self, indices, allow_fill: bool = ..., fill_value=...): ...
def take(self, indices, *, allow_fill: bool = ..., fill_value=...): ...
def searchsorted(self, v, side: str = ..., sorter=...): ...
def copy(self): ...
def astype(self, dtype=..., copy: bool = ...): ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ class IndexOpsMixin:
self, value, side: Literal["left", "right"] = ..., sorter=...
) -> int | list[int]: ...
def drop_duplicates(
self, keep: NaPosition | Literal[False] = ...
self, *, keep: NaPosition | Literal[False] = ...
) -> IndexOpsMixin: ...
2 changes: 0 additions & 2 deletions pandas-stubs/core/computation/eval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def eval(
expr: str | BinOp,
parser: Literal["pandas", "python"] = ...,
engine: Literal["python", "numexpr"] | None = ...,
# Keyword only due to omitted deprecated argument
*,
local_dict: dict[str, Any] | None = ...,
global_dict: dict[str, Any] | None = ...,
resolvers: list[Mapping] | None = ...,
Expand Down
Loading