Skip to content

Commit ac20a93

Browse files
committed
address comments
1 parent 99a0686 commit ac20a93

File tree

4 files changed

+25
-37
lines changed

4 files changed

+25
-37
lines changed

pandas-stubs/_testing/__init__.pyi

Lines changed: 9 additions & 6 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
)
@@ -81,10 +80,16 @@ def assert_period_array_equal(
8180
left: PeriodArray, right: PeriodArray, obj: str = "PeriodArray"
8281
) -> None: ...
8382
def assert_datetime_array_equal(
84-
left: DatetimeArray, right: DatetimeArray, check_freq: bool = True
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 = True
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,
@@ -184,6 +189,4 @@ def assert_produces_warning(
184189
match: str | None = None,
185190
) -> Generator[list[warnings.WarningMessage], None, None]: ...
186191
@contextmanager
187-
def ensure_clean(
188-
filename: str | None = None, return_filelike: bool = False, **kwargs: Any
189-
) -> Generator[str, None, None]: ...
192+
def ensure_clean(filename: str | None = None) -> Generator[str, None, None]: ...

pandas-stubs/core/frame.pyi

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -470,28 +470,13 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
470470
into: type[dict] = ...,
471471
index: bool = ...,
472472
) -> dict[Hashable, Any]: ...
473-
def to_gbq(
474-
self,
475-
destination_table: str,
476-
*,
477-
project_id: str | None = ...,
478-
chunksize: int | None = ...,
479-
reauth: bool = ...,
480-
if_exists: Literal["fail", "replace", "append"] = ...,
481-
auth_local_webserver: bool = ...,
482-
table_schema: list[dict[str, str]] | None = ...,
483-
location: str | None = ...,
484-
progress_bar: bool = ...,
485-
# Google type, not available
486-
credentials: Any = ...,
487-
) -> None: ...
488473
@classmethod
489474
def from_records(
490475
cls,
491476
data,
492477
index=...,
493-
exclude: Sequence[str] | None = None,
494-
columns: Sequence[str] | None = None,
478+
exclude: SequenceNotStr[str] | None = None,
479+
columns: SequenceNotStr[str] | None = None,
495480
coerce_float: bool = False,
496481
nrows: int | None = None,
497482
) -> Self: ...
@@ -1596,11 +1581,11 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15961581
other: DataFrame | Series,
15971582
axis: Axis | None = 0,
15981583
drop: _bool = False,
1599-
method: Literal["pearson", "kendall", "spearman"] = ...,
1584+
method: Literal["pearson", "kendall", "spearman"] = "pearson",
16001585
numeric_only: _bool = False,
16011586
) -> Series: ...
1602-
def count(self, axis: Axis = 0, numeric_only: _bool = ...) -> Series[int]: ...
1603-
def nunique(self, axis: Axis = 0, dropna: bool = ...) -> Series: ...
1587+
def count(self, axis: Axis = 0, numeric_only: _bool = False) -> Series[int]: ...
1588+
def nunique(self, axis: Axis = 0, dropna: bool = True) -> Series[int]: ...
16041589
def idxmax(
16051590
self,
16061591
axis: Axis = 0,
@@ -1681,7 +1666,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
16811666
grid: _bool = True,
16821667
figsize: tuple[float, float] | None = None,
16831668
layout: tuple[int, int] | None = None,
1684-
return_type: Literal["axes", "dict", "both"] | None = "axes",
1669+
return_type: Literal["axes", "dict", "both"] | None = None,
16851670
backend: _str | None = None,
16861671
**kwargs: Any,
16871672
): ...
@@ -1805,7 +1790,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
18051790
self,
18061791
start_time: _str | dt.time,
18071792
end_time: _str | dt.time,
1808-
inclusive: IntervalClosedType = ...,
1793+
inclusive: IntervalClosedType = "both",
18091794
axis: Axis | None = 0,
18101795
) -> Self: ...
18111796
@overload
@@ -2377,7 +2362,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23772362
) -> Self: ...
23782363
def sum(
23792364
self,
2380-
axis: Axis = ...,
2365+
axis: Axis = 0,
23812366
skipna: _bool | None = True,
23822367
numeric_only: _bool = False,
23832368
min_count: int = 0,

pandas-stubs/core/indexes/datetimelike.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ class DatetimeIndexOpsMixin(ExtensionIndex[S1]):
1818
@property
1919
def is_all_dates(self) -> bool: ...
2020
def min(
21-
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
21+
self, axis: AxisIndex | None = None, skipna: bool = True, *args, **kwargs
2222
) -> S1: ...
2323
def argmin(
24-
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
24+
self, axis: AxisIndex | None = None, skipna: bool = True, *args, **kwargs
2525
) -> np.int64: ...
2626
def max(
27-
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
27+
self, axis: AxisIndex | None = None, skipna: bool = True, *args, **kwargs
2828
) -> S1: ...
2929
def argmax(
30-
self, axis: AxisIndex | None = ..., skipna: bool = ..., *args, **kwargs
30+
self, axis: AxisIndex | None = None, skipna: bool = True, *args, **kwargs
3131
) -> np.int64: ...
3232
def __rsub__( # type: ignore[override]
3333
self, other: DatetimeIndexOpsMixin

pandas-stubs/core/series.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
11451145
self,
11461146
periods: int | Sequence[int] = ...,
11471147
freq: DateOffset | timedelta | _str | None = None,
1148-
axis: Axis | None = None,
1148+
axis: Axis = 0,
11491149
fill_value: Scalar | NAType | None = ...,
11501150
) -> Series: ...
11511151
def info(
@@ -1984,9 +1984,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
19841984
min_periods: int = 0,
19851985
adjust: _bool = True,
19861986
ignore_na: _bool = False,
1987-
axis: Axes = ...,
1988-
times: np.ndarray | Series | None = ...,
1989-
method: CalculationMethod = ...,
1987+
axis: Axis = 0,
1988+
times: np.ndarray | Series | None = None,
1989+
method: CalculationMethod = "single",
19901990
) -> ExponentialMovingWindow[Series]: ...
19911991
@final
19921992
def expanding(

0 commit comments

Comments
 (0)