Skip to content

Commit 0f4ac7c

Browse files
committed
Add more parameter defaults
1 parent 6f479f6 commit 0f4ac7c

File tree

17 files changed

+314
-314
lines changed

17 files changed

+314
-314
lines changed

pandas-stubs/_testing/__init__.pyi

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,19 @@ def assert_extension_array_equal(
115115
def assert_series_equal(
116116
left: Series,
117117
right: Series,
118-
check_dtype: bool | Literal["equiv"] = ...,
119-
check_index_type: bool | Literal["equiv"] = ...,
120-
check_series_type: bool = ...,
121-
check_names: bool = ...,
118+
check_dtype: bool | Literal["equiv"] = True,
119+
check_index_type: bool | Literal["equiv"] = "equiv",
120+
check_series_type: bool = True,
121+
check_names: bool = True,
122122
check_exact: bool = ...,
123-
check_datetimelike_compat: bool = ...,
124-
check_categorical: bool = ...,
125-
check_category_order: bool = ...,
126-
check_freq: bool = ...,
127-
check_flags: bool = ...,
123+
check_datetimelike_compat: bool = False,
124+
check_categorical: bool = True,
125+
check_category_order: bool = True,
126+
check_freq: bool = True,
127+
check_flags: bool = True,
128128
rtol: float = ...,
129129
atol: float = ...,
130-
obj: str = ...,
130+
obj: str = "Series",
131131
*,
132132
check_index: Literal[False],
133133
check_like: Literal[False] = ...,
@@ -136,19 +136,19 @@ def assert_series_equal(
136136
def assert_series_equal(
137137
left: Series,
138138
right: Series,
139-
check_dtype: bool | Literal["equiv"] = ...,
140-
check_index_type: bool | Literal["equiv"] = ...,
141-
check_series_type: bool = ...,
142-
check_names: bool = ...,
139+
check_dtype: bool | Literal["equiv"] = True,
140+
check_index_type: bool | Literal["equiv"] = "equiv",
141+
check_series_type: bool = True,
142+
check_names: bool = True,
143143
check_exact: bool = ...,
144-
check_datetimelike_compat: bool = ...,
145-
check_categorical: bool = ...,
146-
check_category_order: bool = ...,
147-
check_freq: bool = ...,
148-
check_flags: bool = ...,
144+
check_datetimelike_compat: bool = False,
145+
check_categorical: bool = True,
146+
check_category_order: bool = True,
147+
check_freq: bool = True,
148+
check_flags: bool = True,
149149
rtol: float = ...,
150150
atol: float = ...,
151-
obj: str = ...,
151+
obj: str = "Series",
152152
*,
153153
check_index: Literal[True] = ...,
154154
check_like: bool = ...,

pandas-stubs/core/algorithms.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ def unique(values: ExtensionArray) -> ExtensionArray: ...
4444
@overload
4545
def factorize(
4646
values: np.ndarray,
47-
sort: bool = ...,
48-
use_na_sentinel: bool = ...,
49-
size_hint: int | None = ...,
47+
sort: bool = False,
48+
use_na_sentinel: bool = True,
49+
size_hint: int | None = None,
5050
) -> tuple[np.ndarray, np.ndarray]: ...
5151
@overload
5252
def factorize(
5353
values: Index | Series,
54-
sort: bool = ...,
55-
use_na_sentinel: bool = ...,
56-
size_hint: int | None = ...,
54+
sort: bool = False,
55+
use_na_sentinel: bool = True,
56+
size_hint: int | None = None,
5757
) -> tuple[np.ndarray, Index]: ...
5858
@overload
5959
def factorize(
6060
values: Categorical,
61-
sort: bool = ...,
62-
use_na_sentinel: bool = ...,
63-
size_hint: int | None = ...,
61+
sort: bool = False,
62+
use_na_sentinel: bool = True,
63+
size_hint: int | None = None,
6464
) -> tuple[np.ndarray, Categorical]: ...
6565
def value_counts(
6666
values: AnyArrayLike | list | tuple,

pandas-stubs/core/computation/eval.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ from pandas._typing import (
1818
def eval(
1919
expr: str | BinOp,
2020
parser: Literal["pandas", "python"] = "pandas",
21-
engine: Literal["python", "numexpr"] | None = ...,
21+
engine: Literal["python", "numexpr"] | None = None,
2222
local_dict: dict[str, Any] | None = None,
2323
global_dict: dict[str, Any] | None = None,
2424
resolvers: list[Mapping] | None = ...,

pandas-stubs/core/groupby/generic.pyi

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -308,49 +308,49 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
308308
@overload
309309
def boxplot(
310310
self,
311-
subplots: Literal[True] = ...,
312-
column: IndexLabel | None = ...,
313-
fontsize: float | str | None = ...,
314-
rot: float = ...,
315-
grid: bool = ...,
316-
ax: PlotAxes | None = ...,
317-
figsize: tuple[float, float] | None = ...,
318-
layout: tuple[int, int] | None = ...,
319-
sharex: bool = ...,
320-
sharey: bool = ...,
321-
backend: str | None = ...,
311+
subplots: Literal[True] = True,
312+
column: IndexLabel | None = None,
313+
fontsize: float | str | None = None,
314+
rot: float = 0,
315+
grid: bool = True,
316+
ax: PlotAxes | None = None,
317+
figsize: tuple[float, float] | None = None,
318+
layout: tuple[int, int] | None = None,
319+
sharex: bool = False,
320+
sharey: bool = True,
321+
backend: str | None = None,
322322
**kwargs,
323323
) -> Series: ... # Series[PlotAxes] but this is not allowed
324324
@overload
325325
def boxplot(
326326
self,
327327
subplots: Literal[False],
328-
column: IndexLabel | None = ...,
329-
fontsize: float | str | None = ...,
330-
rot: float = ...,
331-
grid: bool = ...,
332-
ax: PlotAxes | None = ...,
333-
figsize: tuple[float, float] | None = ...,
334-
layout: tuple[int, int] | None = ...,
335-
sharex: bool = ...,
336-
sharey: bool = ...,
337-
backend: str | None = ...,
328+
column: IndexLabel | None = None,
329+
fontsize: float | str | None = None,
330+
rot: float = 0,
331+
grid: bool = True,
332+
ax: PlotAxes | None = None,
333+
figsize: tuple[float, float] | None = None,
334+
layout: tuple[int, int] | None = None,
335+
sharex: bool = False,
336+
sharey: bool = True,
337+
backend: str | None = None,
338338
**kwargs,
339339
) -> PlotAxes: ...
340340
@overload
341341
def boxplot(
342342
self,
343343
subplots: bool,
344-
column: IndexLabel | None = ...,
345-
fontsize: float | str | None = ...,
346-
rot: float = ...,
347-
grid: bool = ...,
348-
ax: PlotAxes | None = ...,
349-
figsize: tuple[float, float] | None = ...,
350-
layout: tuple[int, int] | None = ...,
351-
sharex: bool = ...,
352-
sharey: bool = ...,
353-
backend: str | None = ...,
344+
column: IndexLabel | None = None,
345+
fontsize: float | str | None = None,
346+
rot: float = 0,
347+
grid: bool = True,
348+
ax: PlotAxes | None = None,
349+
figsize: tuple[float, float] | None = None,
350+
layout: tuple[int, int] | None = None,
351+
sharex: bool = False,
352+
sharey: bool = True,
353+
backend: str | None = None,
354354
**kwargs,
355355
) -> PlotAxes | Series: ... # Series[PlotAxes]
356356
@overload

pandas-stubs/core/indexes/datetimes.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,22 @@ def date_range(
113113
) -> DatetimeIndex: ...
114114
@overload
115115
def bdate_range(
116-
start: str | DateAndDatetimeLike | None = ...,
117-
end: str | DateAndDatetimeLike | None = ...,
118-
periods: int | None = ...,
119-
freq: str | timedelta | Timedelta | BaseOffset = ...,
120-
tz: TimeZones = ...,
121-
normalize: bool = ...,
122-
name: Hashable | None = ...,
123-
weekmask: str | None = ...,
124-
holidays: None = ...,
125-
inclusive: IntervalClosedType = ...,
116+
start: str | DateAndDatetimeLike | None = None,
117+
end: str | DateAndDatetimeLike | None = None,
118+
periods: int | None = None,
119+
freq: str | timedelta | Timedelta | BaseOffset = "B",
120+
tz: TimeZones = None,
121+
normalize: bool = True,
122+
name: Hashable | None = None,
123+
weekmask: str | None = None,
124+
holidays: None = None,
125+
inclusive: IntervalClosedType = "both",
126126
) -> DatetimeIndex: ...
127127
@overload
128128
def bdate_range(
129-
start: str | DateAndDatetimeLike | None = ...,
130-
end: str | DateAndDatetimeLike | None = ...,
131-
periods: int | None = ...,
129+
start: str | DateAndDatetimeLike | None = None,
130+
end: str | DateAndDatetimeLike | None = None,
131+
periods: int | None = None,
132132
*,
133133
freq: str | timedelta | Timedelta | BaseOffset,
134134
tz: TimeZones = ...,

pandas-stubs/core/indexes/interval.pyi

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -310,30 +310,30 @@ class IntervalIndex(ExtensionIndex[IntervalT], IntervalMixin):
310310
# int gets hit first and so the correct type is returned
311311
@overload
312312
def interval_range( # pyright: ignore[reportOverlappingOverload]
313-
start: int | None = ...,
314-
end: int | None = ...,
315-
periods: int | None = ...,
316-
freq: int | None = ...,
317-
name: Hashable = ...,
318-
closed: IntervalClosedType = ...,
313+
start: int | None = None,
314+
end: int | None = None,
315+
periods: int | None = None,
316+
freq: int | None = None,
317+
name: Hashable = None,
318+
closed: IntervalClosedType = "right",
319319
) -> IntervalIndex[Interval[int]]: ...
320320
@overload
321321
def interval_range(
322-
start: float | None = ...,
323-
end: float | None = ...,
324-
periods: int | None = ...,
325-
freq: int | None = ...,
326-
name: Hashable = ...,
327-
closed: IntervalClosedType = ...,
322+
start: float | None = None,
323+
end: float | None = None,
324+
periods: int | None = None,
325+
freq: int | None = None,
326+
name: Hashable = None,
327+
closed: IntervalClosedType = "right",
328328
) -> IntervalIndex[Interval[float]]: ...
329329
@overload
330330
def interval_range(
331331
start: _TimestampLike,
332-
end: _TimestampLike | None = ...,
333-
periods: int | None = ...,
334-
freq: str | BaseOffset | pd.Timedelta | dt.timedelta | None = ...,
335-
name: Hashable = ...,
336-
closed: IntervalClosedType = ...,
332+
end: _TimestampLike | None = None,
333+
periods: int | None = None,
334+
freq: str | BaseOffset | pd.Timedelta | dt.timedelta | None = None,
335+
name: Hashable = None,
336+
closed: IntervalClosedType = "right",
337337
) -> IntervalIndex[Interval[pd.Timestamp]]: ...
338338
@overload
339339
def interval_range(
@@ -348,11 +348,11 @@ def interval_range(
348348
@overload
349349
def interval_range(
350350
start: _TimedeltaLike,
351-
end: _TimedeltaLike | None = ...,
352-
periods: int | None = ...,
353-
freq: str | BaseOffset | pd.Timedelta | dt.timedelta | None = ...,
354-
name: Hashable = ...,
355-
closed: IntervalClosedType = ...,
351+
end: _TimedeltaLike | None = None,
352+
periods: int | None = None,
353+
freq: str | BaseOffset | pd.Timedelta | dt.timedelta | None = None,
354+
name: Hashable = None,
355+
closed: IntervalClosedType = "right",
356356
) -> IntervalIndex[Interval[pd.Timedelta]]: ...
357357
@overload
358358
def interval_range(

pandas-stubs/core/reshape/merge.pyi

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,42 +38,42 @@ def merge(
3838
def merge_ordered(
3939
left: DataFrame,
4040
right: DataFrame,
41-
on: Label | list[HashableT] | None = ...,
42-
left_on: Label | list[HashableT] | None = ...,
43-
right_on: Label | list[HashableT] | None = ...,
44-
left_by: Label | list[HashableT] | None = ...,
45-
right_by: Label | list[HashableT] | None = ...,
46-
fill_method: Literal["ffill"] | None = ...,
41+
on: Label | list[HashableT] | None = None,
42+
left_on: Label | list[HashableT] | None = None,
43+
right_on: Label | list[HashableT] | None = None,
44+
left_by: Label | list[HashableT] | None = None,
45+
right_by: Label | list[HashableT] | None = None,
46+
fill_method: Literal["ffill"] | None = None,
4747
suffixes: Suffixes = ...,
48-
how: JoinHow = ...,
48+
how: JoinHow = "outer",
4949
) -> DataFrame: ...
5050
@overload
5151
def merge_ordered(
5252
left: Series,
5353
right: DataFrame | Series,
54-
on: Label | list[HashableT] | None = ...,
55-
left_on: Label | list[HashableT] | None = ...,
56-
right_on: Label | list[HashableT] | None = ...,
57-
left_by: None = ...,
58-
right_by: None = ...,
59-
fill_method: Literal["ffill"] | None = ...,
54+
on: Label | list[HashableT] | None = None,
55+
left_on: Label | list[HashableT] | None = None,
56+
right_on: Label | list[HashableT] | None = None,
57+
left_by: None = None,
58+
right_by: None = None,
59+
fill_method: Literal["ffill"] | None = None,
6060
suffixes: (
6161
list[str | None] | tuple[str, str] | tuple[None, str] | tuple[str, None]
6262
) = ...,
63-
how: JoinHow = ...,
63+
how: JoinHow = "outer",
6464
) -> DataFrame: ...
6565
@overload
6666
def merge_ordered(
6767
left: DataFrame | Series,
6868
right: Series,
69-
on: Label | list[HashableT] | None = ...,
70-
left_on: Label | list[HashableT] | None = ...,
71-
right_on: Label | list[HashableT] | None = ...,
72-
left_by: None = ...,
73-
right_by: None = ...,
74-
fill_method: Literal["ffill"] | None = ...,
69+
on: Label | list[HashableT] | None = None,
70+
left_on: Label | list[HashableT] | None = None,
71+
right_on: Label | list[HashableT] | None = None,
72+
left_by: None = None,
73+
right_by: None = None,
74+
fill_method: Literal["ffill"] | None = None,
7575
suffixes: Suffixes = ...,
76-
how: JoinHow = ...,
76+
how: JoinHow = "outer",
7777
) -> DataFrame: ...
7878
def merge_asof(
7979
left: DataFrame | Series,

0 commit comments

Comments
 (0)