Skip to content

Add defaults for parameters #1293

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 23 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions pandas-stubs/_libs/tslibs/nattype.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class NaTType:
def weekday(self) -> float: ...
def isoweekday(self) -> float: ...
def total_seconds(self) -> float: ...
def today(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
def now(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
def today(self, tz: _tzinfo | str | None = None) -> NaTType: ...
def now(self, tz: _tzinfo | str | None = None) -> NaTType: ...
def to_pydatetime(self) -> NaTType: ...
def date(self) -> NaTType: ...
def round(
Expand Down
8 changes: 4 additions & 4 deletions pandas-stubs/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ class Timestamp(datetime, SupportsIndex):
@classmethod
def utcfromtimestamp(cls, ts: float) -> Self: ...
@classmethod
def today(cls, tz: _tzinfo | str | None = ...) -> Self: ...
def today(cls, tz: _tzinfo | str | None = None) -> Self: ...
@classmethod
def fromordinal(
cls,
ordinal: int,
tz: _tzinfo | str | None = ...,
) -> Self: ...
@classmethod
def now(cls, tz: _tzinfo | str | None = ...) -> Self: ...
def now(cls, tz: _tzinfo | str | None = None) -> Self: ...
@classmethod
def utcnow(cls) -> Self: ...
# error: Signature of "combine" incompatible with supertype "datetime"
Expand Down Expand Up @@ -299,8 +299,8 @@ class Timestamp(datetime, SupportsIndex):
ambiguous: _Ambiguous = ...,
nonexistent: TimestampNonexistent = ...,
) -> Self: ...
def day_name(self, locale: str | None = ...) -> str: ...
def month_name(self, locale: str | None = ...) -> str: ...
def day_name(self, locale: str | None = None) -> str: ...
def month_name(self, locale: str | None = None) -> str: ...
@property
def day_of_week(self) -> int: ...
@property
Expand Down
8 changes: 4 additions & 4 deletions pandas-stubs/_testing/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ def assert_numpy_array_equal(
right,
strict_nan: bool = ...,
check_dtype: bool | Literal["equiv"] = ...,
err_msg: str | None = ...,
check_same: Literal["copy", "same"] | None = ...,
err_msg: str | None = None,
check_same: Literal["copy", "same"] | None = None,
obj: str = ...,
index_values: Index | np.ndarray | None = ...,
index_values: Index | np.ndarray | None = None,
) -> None: ...
def assert_extension_array_equal(
left: ExtensionArray,
right: ExtensionArray,
check_dtype: bool | Literal["equiv"] = ...,
index_values: Index | np.ndarray | None = ...,
index_values: Index | np.ndarray | None = None,
check_exact: bool = ...,
rtol: float = ...,
atol: float = ...,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ExtensionArray:
def argsort(
self, *, ascending: bool = ..., kind: str = ..., **kwargs
) -> np.ndarray: ...
def fillna(self, value=..., method=..., limit=...): ...
def fillna(self, value=..., method=None, limit=None): ...
def dropna(self): ...
def shift(self, periods: int = ..., fill_value: object = ...) -> Self: ...
def unique(self): ...
Expand Down
7 changes: 5 additions & 2 deletions pandas-stubs/core/arrays/categorical.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ class Categorical(ExtensionArray):
def as_ordered(self) -> Categorical: ...
def as_unordered(self) -> Categorical: ...
def set_categories(
self, new_categories, ordered: bool | None = ..., rename: bool = ...
self,
new_categories,
ordered: bool | None = ...,
rename: bool = ...,
) -> Categorical: ...
def rename_categories(self, new_categories) -> Categorical: ...
def reorder_categories(
Expand Down Expand Up @@ -107,7 +110,7 @@ class Categorical(ExtensionArray):
self, *, inplace: bool = ..., ascending: bool = ..., na_position: str = ...
): ...
def view(self, dtype=...): ...
def fillna(self, value=..., method=..., limit=...): ...
def fillna(self, value=..., method=None, limit=None): ...
def take(
self, indexer: TakeIndexer, *, allow_fill: bool = ..., fill_value=...
) -> Categorical: ...
Expand Down
17 changes: 13 additions & 4 deletions pandas-stubs/core/arrays/datetimelike.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ class TimelikeOps:
def unit(self) -> TimeUnit: ...
def as_unit(self, unit: TimeUnit) -> Self: ...
def round(
self, freq, ambiguous: TimeAmbiguous = ..., nonexistent: TimeNonexistent = ...
self,
freq,
ambiguous: TimeAmbiguous = ...,
nonexistent: TimeNonexistent = ...,
): ...
def floor(
self, freq, ambiguous: TimeAmbiguous = ..., nonexistent: TimeNonexistent = ...
self,
freq,
ambiguous: TimeAmbiguous = ...,
nonexistent: TimeNonexistent = ...,
): ...
def ceil(
self, freq, ambiguous: TimeAmbiguous = ..., nonexistent: TimeNonexistent = ...
self,
freq,
ambiguous: TimeAmbiguous = ...,
nonexistent: TimeNonexistent = ...,
): ...

class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
Expand Down Expand Up @@ -80,7 +89,7 @@ class DatetimeLikeArrayMixin(ExtensionOpsMixin, ExtensionArray):
def value_counts(self, dropna: bool = ...): ...
def map(self, mapper): ...
def isna(self): ...
def fillna(self, value=..., method=..., limit=...): ...
def fillna(self, value=..., method=None, limit=None): ...
@property
def freq(self): ...
@freq.setter
Expand Down
25 changes: 21 additions & 4 deletions pandas-stubs/core/arrays/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,30 @@ class IntervalArray(IntervalMixin, ExtensionArray):
cls, data, closed=..., dtype=..., copy: bool = ..., verify_integrity: bool = ...
): ...
@classmethod
def from_breaks(cls, breaks, closed: str = ..., copy: bool = ..., dtype=...): ...
def from_breaks(
cls,
breaks,
closed: str = ...,
copy: bool = ...,
dtype=None,
): ...
@classmethod
def from_arrays(
cls, left, right, closed: str = ..., copy: bool = ..., dtype=...
cls,
left,
right,
closed: str = ...,
copy: bool = ...,
dtype=...,
): ...
@classmethod
def from_tuples(cls, data, closed: str = ..., copy: bool = ..., dtype=...): ...
def from_tuples(
cls,
data,
closed: str = ...,
copy: bool = ...,
dtype=None,
): ...
def __iter__(self): ...
def __len__(self) -> int: ...
@overload
Expand All @@ -48,7 +65,7 @@ class IntervalArray(IntervalMixin, ExtensionArray):
def __setitem__(self, key, value) -> None: ...
def __eq__(self, other): ...
def __ne__(self, other): ...
def fillna(self, value=..., method=..., limit=...): ...
def fillna(self, value=..., method=None, limit=None): ...
@property
def dtype(self): ...
def astype(self, dtype, copy: bool = ...): ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/string_.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class StringArray(PandasArray):
def __init__(self, values, copy: bool = ...) -> None: ...
def __arrow_array__(self, type=...): ...
def __setitem__(self, key, value) -> None: ...
def fillna(self, value=..., method=..., limit=...): ...
def fillna(self, value=..., method=None, limit=None): ...
def astype(self, dtype, copy: bool = ...): ...
def value_counts(self, dropna: bool = ...): ...
12 changes: 10 additions & 2 deletions pandas-stubs/core/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,18 @@ class IndexOpsMixin(OpsMixin, Generic[S1]):
def max(self, axis=..., skipna: bool = ..., **kwargs): ...
def min(self, axis=..., skipna: bool = ..., **kwargs): ...
def argmax(
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
self,
axis: AxisIndex | None = ...,
skipna: bool = ...,
*args,
**kwargs,
) -> np.int64: ...
def argmin(
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
self,
axis: AxisIndex | None = ...,
skipna: bool = ...,
*args,
**kwargs,
) -> np.int64: ...
def tolist(self) -> list[S1]: ...
def to_list(self) -> list[S1]: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/computation/eval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def eval(
global_dict: dict[str, Any] | None = ...,
resolvers: list[Mapping] | None = ...,
level: int = ...,
target: object | None = ...,
target: object | None = None,
inplace: bool = ...,
) -> npt.NDArray | Scalar | DataFrame | Series | None: ...
4 changes: 3 additions & 1 deletion pandas-stubs/core/dtypes/concat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ from pandas import (
_CatT = TypeVar("_CatT", bound=Categorical | CategoricalIndex | Series)

def union_categoricals(
to_union: list[_CatT], sort_categories: bool = ..., ignore_order: bool = ...
to_union: list[_CatT],
sort_categories: bool = ...,
ignore_order: bool = ...,
) -> Categorical: ...
Loading
Loading