Skip to content

Commit 2f661ae

Browse files
committed
Merge branch 'main' into hotfix/cmp0xff/gh718-drop-tss
2 parents 368c3ff + ace58ea commit 2f661ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1472
-1391
lines changed

pandas-stubs/__init__.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ from pandas.io.api import (
119119
read_stata as read_stata,
120120
read_table as read_table,
121121
read_xml as read_xml,
122-
to_pickle as to_pickle,
123122
)
124123
from pandas.io.json._normalize import json_normalize as json_normalize
125124
from pandas.tseries import offsets as offsets

pandas-stubs/_libs/lib.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class _NoDefault(Enum):
1616
no_default: Final = _NoDefault.no_default
1717
_NoDefaultDoNotUse: TypeAlias = Literal[_NoDefault.no_default] # noqa: PYI047
1818

19-
def infer_dtype(value: object, skipna: bool = ...) -> str: ...
19+
def infer_dtype(value: object, skipna: bool = True) -> str: ...
2020
def is_iterator(obj: object) -> bool: ...
2121
def is_scalar(val: object) -> bool: ...
22-
def is_list_like(obj: object, allow_sets: bool = ...) -> bool: ...
22+
def is_list_like(obj: object, allow_sets: bool = True) -> bool: ...
2323
def is_complex(val: object) -> TypeGuard[complex]: ...
2424
def is_bool(val: object) -> TypeGuard[bool | np.bool_]: ...
2525
def is_integer(val: object) -> TypeGuard[int | np.integer]: ...

pandas-stubs/_libs/tslibs/nattype.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,34 @@ class NaTType:
7474
def weekday(self) -> float: ...
7575
def isoweekday(self) -> float: ...
7676
def total_seconds(self) -> float: ...
77-
def today(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
78-
def now(self, tz: _tzinfo | str | None = ...) -> NaTType: ...
77+
def today(self, tz: _tzinfo | str | None = None) -> NaTType: ...
78+
def now(self, tz: _tzinfo | str | None = None) -> NaTType: ...
7979
def to_pydatetime(self) -> NaTType: ...
8080
def date(self) -> NaTType: ...
8181
def round(
8282
self,
8383
freq: Frequency,
84-
ambiguous: bool | Literal["raise"] | NaTType = ...,
85-
nonexistent: TimestampNonexistent = ...,
84+
ambiguous: bool | Literal["raise"] | NaTType = "raise",
85+
nonexistent: TimestampNonexistent = "raise",
8686
) -> NaTType: ...
8787
def floor(
8888
self,
8989
freq: Frequency,
90-
ambiguous: bool | Literal["raise"] | NaTType = ...,
91-
nonexistent: TimestampNonexistent = ...,
90+
ambiguous: bool | Literal["raise"] | NaTType = "raise",
91+
nonexistent: TimestampNonexistent = "raise",
9292
) -> NaTType: ...
9393
def ceil(
9494
self,
9595
freq: Frequency,
96-
ambiguous: bool | Literal["raise"] | NaTType = ...,
97-
nonexistent: TimestampNonexistent = ...,
96+
ambiguous: bool | Literal["raise"] | NaTType = "raise",
97+
nonexistent: TimestampNonexistent = "raise",
9898
) -> NaTType: ...
9999
def tz_convert(self) -> NaTType: ...
100100
def tz_localize(
101101
self,
102102
tz: _tzinfo | str | None,
103-
ambiguous: bool | Literal["raise"] | NaTType = ...,
104-
nonexistent: TimestampNonexistent = ...,
103+
ambiguous: bool | Literal["raise"] | NaTType = "raise",
104+
nonexistent: TimestampNonexistent = "raise",
105105
) -> NaTType: ...
106106
def replace(
107107
self,
@@ -154,4 +154,4 @@ class NaTType:
154154
__ge__: _NatComparison
155155
@property
156156
def unit(self) -> TimeUnit: ...
157-
def as_unit(self, unit: TimeUnit, round_ok: bool = ...) -> Self: ...
157+
def as_unit(self, unit: TimeUnit, round_ok: bool = True) -> Self: ...

pandas-stubs/_libs/tslibs/period.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ class Period(PeriodMixin):
197197
def day_of_year(self) -> int: ...
198198
@property
199199
def day_of_week(self) -> int: ...
200-
def asfreq(self, freq: str | BaseOffset, how: _PeriodFreqHow = ...) -> Period: ...
200+
def asfreq(self, freq: str | BaseOffset, how: _PeriodFreqHow = "end") -> Period: ...
201201
@classmethod
202202
def now(cls, freq: str | BaseOffset = ...) -> Period: ...
203203
def strftime(self, fmt: str) -> str: ...
204204
def to_timestamp(
205205
self,
206206
freq: str | BaseOffset | None = ...,
207-
how: _PeriodToTimestampHow = ...,
207+
how: _PeriodToTimestampHow = "S",
208208
) -> Timestamp: ...

pandas-stubs/_libs/tslibs/timedeltas.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,4 @@ class Timedelta(timedelta):
385385
def view(self, dtype: npt.DTypeLike = ...) -> object: ...
386386
@property
387387
def unit(self) -> TimeUnit: ...
388-
def as_unit(self, unit: TimeUnit, round_ok: bool = ...) -> Self: ...
388+
def as_unit(self, unit: TimeUnit, round_ok: bool = True) -> Self: ...

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ class Timestamp(datetime, SupportsIndex):
114114
@classmethod
115115
def utcfromtimestamp(cls, ts: float) -> Self: ...
116116
@classmethod
117-
def today(cls, tz: _tzinfo | str | None = ...) -> Self: ...
117+
def today(cls, tz: _tzinfo | str | None = None) -> Self: ...
118118
@classmethod
119119
def fromordinal(
120120
cls,
121121
ordinal: int,
122122
tz: _tzinfo | str | None = ...,
123123
) -> Self: ...
124124
@classmethod
125-
def now(cls, tz: _tzinfo | str | None = ...) -> Self: ...
125+
def now(cls, tz: _tzinfo | str | None = None) -> Self: ...
126126
@classmethod
127127
def utcnow(cls) -> Self: ...
128128
# error: Signature of "combine" incompatible with supertype "datetime"
@@ -156,7 +156,19 @@ class Timestamp(datetime, SupportsIndex):
156156
) -> Timestamp: ...
157157
def astimezone(self, tz: _tzinfo | None = ...) -> Self: ...
158158
def ctime(self) -> str: ...
159-
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
159+
def isoformat( # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
160+
self,
161+
sep: str = "T",
162+
timespec: Literal[
163+
"auto",
164+
"hours",
165+
"minutes",
166+
"seconds",
167+
"milliseconds",
168+
"microseconds",
169+
"nanoseconds",
170+
] = "auto",
171+
) -> str: ...
160172
@classmethod
161173
def strptime(cls, date_string: Never, format: Never) -> Never: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
162174
def utcoffset(self) -> timedelta | None: ...
@@ -275,31 +287,31 @@ class Timestamp(datetime, SupportsIndex):
275287
def tz_localize(
276288
self,
277289
tz: TimeZones,
278-
ambiguous: _Ambiguous = ...,
279-
nonexistent: TimestampNonexistent = ...,
290+
ambiguous: _Ambiguous = "raise",
291+
nonexistent: TimestampNonexistent = "raise",
280292
) -> Self: ...
281293
def normalize(self) -> Self: ...
282294
# TODO: round/floor/ceil could return NaT?
283295
def round(
284296
self,
285297
freq: str,
286-
ambiguous: _Ambiguous = ...,
287-
nonexistent: TimestampNonexistent = ...,
298+
ambiguous: _Ambiguous = "raise",
299+
nonexistent: TimestampNonexistent = "raise",
288300
) -> Self: ...
289301
def floor(
290302
self,
291303
freq: str,
292-
ambiguous: _Ambiguous = ...,
293-
nonexistent: TimestampNonexistent = ...,
304+
ambiguous: _Ambiguous = "raise",
305+
nonexistent: TimestampNonexistent = "raise",
294306
) -> Self: ...
295307
def ceil(
296308
self,
297309
freq: str,
298-
ambiguous: _Ambiguous = ...,
299-
nonexistent: TimestampNonexistent = ...,
310+
ambiguous: _Ambiguous = "raise",
311+
nonexistent: TimestampNonexistent = "raise",
300312
) -> Self: ...
301-
def day_name(self, locale: str | None = ...) -> str: ...
302-
def month_name(self, locale: str | None = ...) -> str: ...
313+
def day_name(self, locale: str | None = None) -> str: ...
314+
def month_name(self, locale: str | None = None) -> str: ...
303315
@property
304316
def day_of_week(self) -> int: ...
305317
@property
@@ -321,6 +333,6 @@ class Timestamp(datetime, SupportsIndex):
321333
def daysinmonth(self) -> int: ...
322334
@property
323335
def unit(self) -> TimeUnit: ...
324-
def as_unit(self, unit: TimeUnit, round_ok: bool = ...) -> Self: ...
336+
def as_unit(self, unit: TimeUnit, round_ok: bool = True) -> Self: ...
325337
# To support slicing
326338
def __index__(self) -> int: ...

pandas-stubs/_testing/__init__.pyi

Lines changed: 59 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from collections.abc import (
55
)
66
from contextlib import contextmanager
77
from typing import (
8-
Any,
98
Literal,
109
overload,
1110
)
@@ -36,29 +35,29 @@ from pandas._typing import (
3635
def assert_almost_equal(
3736
left: T,
3837
right: T,
39-
check_dtype: bool | Literal["equiv"] = ...,
40-
rtol: float = ...,
41-
atol: float = ...,
38+
check_dtype: bool | Literal["equiv"] = "equiv",
39+
rtol: float = 1e-5,
40+
atol: float = 1e-8,
4241
**kwargs,
4342
) -> None: ...
44-
def assert_dict_equal(left: dict, right: dict, compare_keys: bool = ...) -> None: ...
43+
def assert_dict_equal(left: dict, right: dict, compare_keys: bool = True) -> None: ...
4544
def assert_index_equal(
4645
left: Index,
4746
right: Index,
48-
exact: bool | Literal["equiv"] = ...,
49-
check_names: bool = ...,
50-
check_exact: bool = ...,
51-
check_categorical: bool = ...,
52-
check_order: bool = ...,
53-
rtol: float = ...,
54-
atol: float = ...,
55-
obj: str = ...,
47+
exact: bool | Literal["equiv"] = "equiv",
48+
check_names: bool = True,
49+
check_exact: bool = True,
50+
check_categorical: bool = True,
51+
check_order: bool = True,
52+
rtol: float = 1e-5,
53+
atol: float = 1e-8,
54+
obj: str = "Index",
5655
) -> None: ...
5756
def assert_class_equal(
58-
left: T, right: T, exact: bool | Literal["equiv"] = ..., obj: str = ...
57+
left: T, right: T, exact: bool | Literal["equiv"] = True, obj: str = "Input"
5958
) -> None: ...
6059
def assert_attr_equal(
61-
attr: str, left: object, right: object, obj: str = ...
60+
attr: str, left: object, right: object, obj: str = "Attributes"
6261
) -> None: ...
6362
def assert_is_valid_plot_return_object(
6463
objs: Series | np.ndarray | Artist | tuple | dict,
@@ -67,44 +66,50 @@ def assert_is_sorted(seq: AnyArrayLike) -> None: ...
6766
def assert_categorical_equal(
6867
left: Categorical,
6968
right: Categorical,
70-
check_dtype: bool = ...,
71-
check_category_order: bool = ...,
72-
obj: str = ...,
69+
check_dtype: bool = True,
70+
check_category_order: bool = True,
71+
obj: str = "Categorical",
7372
) -> None: ...
7473
def assert_interval_array_equal(
7574
left: IntervalArray,
7675
right: IntervalArray,
77-
exact: bool | Literal["equiv"] = ...,
78-
obj: str = ...,
76+
exact: bool | Literal["equiv"] = "equiv",
77+
obj: str = "IntervalArray",
7978
) -> None: ...
8079
def assert_period_array_equal(
81-
left: PeriodArray, right: PeriodArray, obj: str = ...
80+
left: PeriodArray, right: PeriodArray, obj: str = "PeriodArray"
8281
) -> None: ...
8382
def assert_datetime_array_equal(
84-
left: DatetimeArray, right: DatetimeArray, check_freq: bool = ...
83+
left: DatetimeArray,
84+
right: DatetimeArray,
85+
obj: str = "DatetimeArray",
86+
check_freq: bool = True,
8587
) -> None: ...
8688
def assert_timedelta_array_equal(
87-
left: TimedeltaArray, right: TimedeltaArray, check_freq: bool = ...
89+
left: TimedeltaArray,
90+
right: TimedeltaArray,
91+
obj: str = "TimedeltaArray",
92+
check_freq: bool = True,
8893
) -> None: ...
8994
def assert_numpy_array_equal(
9095
left,
9196
right,
92-
strict_nan: bool = ...,
93-
check_dtype: bool | Literal["equiv"] = ...,
94-
err_msg: str | None = ...,
95-
check_same: Literal["copy", "same"] | None = ...,
96-
obj: str = ...,
97-
index_values: Index | np.ndarray | None = ...,
97+
strict_nan: bool = False,
98+
check_dtype: bool | Literal["equiv"] = True,
99+
err_msg: str | None = None,
100+
check_same: Literal["copy", "same"] | None = None,
101+
obj: str = "numpy array",
102+
index_values: Index | np.ndarray | None = None,
98103
) -> None: ...
99104
def assert_extension_array_equal(
100105
left: ExtensionArray,
101106
right: ExtensionArray,
102-
check_dtype: bool | Literal["equiv"] = ...,
103-
index_values: Index | np.ndarray | None = ...,
104-
check_exact: bool = ...,
105-
rtol: float = ...,
106-
atol: float = ...,
107-
obj: str = ...,
107+
check_dtype: bool | Literal["equiv"] = True,
108+
index_values: Index | np.ndarray | None = None,
109+
check_exact: bool = False,
110+
rtol: float = 1e-5,
111+
atol: float = 1e-8,
112+
obj: str = "ExtensionArray",
108113
) -> None: ...
109114
@overload
110115
def assert_series_equal(
@@ -151,21 +156,21 @@ def assert_series_equal(
151156
def assert_frame_equal(
152157
left: DataFrame,
153158
right: DataFrame,
154-
check_dtype: bool | Literal["equiv"] = ...,
155-
check_index_type: bool | Literal["equiv"] = ...,
156-
check_column_type: bool | Literal["equiv"] = ...,
157-
check_frame_type: bool = ...,
158-
check_names: bool = ...,
159-
by_blocks: bool = ...,
160-
check_exact: bool = ...,
161-
check_datetimelike_compat: bool = ...,
162-
check_categorical: bool = ...,
163-
check_like: bool = ...,
164-
check_freq: bool = ...,
165-
check_flags: bool = ...,
166-
rtol: float = ...,
167-
atol: float = ...,
168-
obj: str = ...,
159+
check_dtype: bool | Literal["equiv"] = True,
160+
check_index_type: bool | Literal["equiv"] = "equiv",
161+
check_column_type: bool | Literal["equiv"] = "equiv",
162+
check_frame_type: bool = True,
163+
check_names: bool = True,
164+
by_blocks: bool = False,
165+
check_exact: bool = False,
166+
check_datetimelike_compat: bool = False,
167+
check_categorical: bool = True,
168+
check_like: bool = False,
169+
check_freq: bool = True,
170+
check_flags: bool = True,
171+
rtol: float = 1e-5,
172+
atol: float = 1e-8,
173+
obj: str = "DataFrame",
169174
) -> None: ...
170175
def assert_equal(left, right, **kwargs) -> None: ...
171176
def assert_sp_array_equal(left: SparseArray, right: SparseArray) -> None: ...
@@ -178,12 +183,10 @@ def assert_produces_warning(
178183
) = ...,
179184
filter_level: Literal[
180185
"error", "ignore", "always", "default", "module", "once"
181-
] = ...,
182-
check_stacklevel: bool = ...,
183-
raise_on_extra_warnings: bool = ...,
186+
] = "always",
187+
check_stacklevel: bool = True,
188+
raise_on_extra_warnings: bool = True,
184189
match: str | None = None,
185190
) -> Generator[list[warnings.WarningMessage], None, None]: ...
186191
@contextmanager
187-
def ensure_clean(
188-
filename: str | None = ..., return_filelike: bool = ..., **kwargs: Any
189-
) -> Generator[str, None, None]: ...
192+
def ensure_clean(filename: str | None = None) -> Generator[str, None, None]: ...

pandas-stubs/core/algorithms.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ def factorize(
6464
) -> tuple[np.ndarray, Categorical]: ...
6565
def value_counts(
6666
values: AnyArrayLike | list | tuple,
67-
sort: bool = ...,
68-
ascending: bool = ...,
69-
normalize: bool = ...,
70-
bins: int | None = ...,
71-
dropna: bool = ...,
67+
sort: bool = True,
68+
ascending: bool = False,
69+
normalize: bool = False,
70+
bins: int | None = None,
71+
dropna: bool = True,
7272
) -> Series: ...
7373
def take(
7474
arr,

0 commit comments

Comments
 (0)