Skip to content

Commit 06bb3bf

Browse files
committed
address some comments
1 parent e086068 commit 06bb3bf

File tree

4 files changed

+35
-43
lines changed

4 files changed

+35
-43
lines changed

pandas-stubs/_libs/tslibs/timestamps.pyi

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,19 @@ class Timestamp(datetime, SupportsIndex):
157157
) -> Timestamp: ...
158158
def astimezone(self, tz: _tzinfo | None = ...) -> Self: ...
159159
def ctime(self) -> str: ...
160-
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ...
160+
def isoformat(
161+
self,
162+
sep: str = "T",
163+
timespec: Literal[
164+
"auto",
165+
"hours",
166+
"minutes",
167+
"seconds",
168+
"milliseconds",
169+
"microseconds",
170+
"nanoseconds",
171+
] = "auto",
172+
) -> str: ...
161173
@classmethod
162174
def strptime(cls, date_string: Never, format: Never) -> Never: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
163175
def utcoffset(self) -> timedelta | None: ...

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 = "numexpr",
21+
engine: Literal["python", "numexpr"] | 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/frame.pyi

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -455,29 +455,15 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
455455
into: type[dict] = ...,
456456
index: bool = ...,
457457
) -> dict[Hashable, Any]: ...
458-
def to_gbq(
459-
self,
460-
destination_table: str,
461-
project_id: str | None = ...,
462-
chunksize: int | None = ...,
463-
reauth: bool = False,
464-
if_exists: Literal["fail", "replace", "append"] = "fail",
465-
auth_local_webserver: bool = True,
466-
table_schema: list[dict[str, str]] | None = ...,
467-
location: str | None = ...,
468-
progress_bar: bool = True,
469-
# Google type, not available
470-
credentials: Any = ...,
471-
) -> None: ...
472458
@classmethod
473459
def from_records(
474460
cls,
475461
data,
476462
index=...,
477-
exclude=None,
478-
columns=None,
479-
coerce_float=False,
480-
nrows=None,
463+
exclude: Sequence[str] | None = None,
464+
columns: Sequence[str] | None = None,
465+
coerce_float: bool = False,
466+
nrows: int | None = None,
481467
) -> Self: ...
482468
def to_records(
483469
self,
@@ -1321,7 +1307,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13211307
margins: _bool = False,
13221308
dropna: _bool = True,
13231309
margins_name: _str = "All",
1324-
observed: _bool = False,
1310+
observed: _bool = True,
13251311
sort: _bool = True,
13261312
) -> Self: ...
13271313
@overload
@@ -1338,7 +1324,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13381324
def unstack(
13391325
self,
13401326
level: IndexLabel = -1,
1341-
fill_value: Scalar | None = ...,
1327+
fill_value: Scalar | None = None,
13421328
sort: _bool = True,
13431329
) -> Self | Series: ...
13441330
def melt(
@@ -1560,20 +1546,20 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15601546
suffixes: Suffixes = ...,
15611547
copy: _bool = True,
15621548
indicator: _bool | _str = False,
1563-
validate: MergeValidate | None = ...,
1549+
validate: MergeValidate | None = None,
15641550
) -> Self: ...
15651551
def round(
15661552
self, decimals: int | dict | Series = ..., *args: Any, **kwargs: Any
15671553
) -> Self: ...
15681554
def corr(
15691555
self,
1570-
method: Literal["pearson", "kendall", "spearman"] = ...,
1556+
method: Literal["pearson", "kendall", "spearman"] = "pearson",
15711557
min_periods: int = ...,
15721558
numeric_only: _bool = False,
15731559
) -> Self: ...
15741560
def cov(
15751561
self,
1576-
min_periods: int | None = ...,
1562+
min_periods: int | None = None,
15771563
ddof: int = 1,
15781564
numeric_only: _bool = False,
15791565
) -> Self: ...
@@ -1639,7 +1625,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
16391625
) -> Self: ...
16401626
def to_period(
16411627
self,
1642-
freq: _str | None = ...,
1628+
freq: _str | None = None,
16431629
axis: Axis = 0,
16441630
copy: _bool = True,
16451631
) -> Self: ...
@@ -1790,7 +1776,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
17901776
def at_time(
17911777
self,
17921778
time: _str | dt.time,
1793-
asof: _bool = ...,
1779+
asof: _bool = False,
17941780
axis: Axis | None = 0,
17951781
) -> Self: ...
17961782
@final
@@ -1892,28 +1878,28 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
18921878
def copy(self, deep: _bool = True) -> Self: ...
18931879
def cummax(
18941880
self,
1895-
axis: Axis | None = 0,
1881+
axis: Axis | None = None,
18961882
skipna: _bool = True,
18971883
*args: Any,
18981884
**kwargs: Any,
18991885
) -> Self: ...
19001886
def cummin(
19011887
self,
1902-
axis: Axis | None = 0,
1888+
axis: Axis | None = None,
19031889
skipna: _bool = True,
19041890
*args: Any,
19051891
**kwargs: Any,
19061892
) -> Self: ...
19071893
def cumprod(
19081894
self,
1909-
axis: Axis | None = 0,
1895+
axis: Axis | None = None,
19101896
skipna: _bool = True,
19111897
*args: Any,
19121898
**kwargs: Any,
19131899
) -> Self: ...
19141900
def cumsum(
19151901
self,
1916-
axis: Axis | None = 0,
1902+
axis: Axis | None = None,
19171903
skipna: _bool = True,
19181904
*args: Any,
19191905
**kwargs: Any,
@@ -1999,8 +1985,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
19991985
level: Level | None = ...,
20001986
fill_value: float | None = None,
20011987
) -> Self: ...
2002-
# def from_dict
2003-
# def from_records
20041988
def ge(self, other, axis: Axis = "columns", level: Level | None = ...) -> Self: ...
20051989
@overload
20061990
def get(self, key: Hashable, default: None = ...) -> Series | None: ...
@@ -2015,7 +1999,6 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
20151999
def head(self, n: int = 5) -> Self: ...
20162000
@final
20172001
def infer_objects(self) -> Self: ...
2018-
# def info
20192002
@overload
20202003
def interpolate(
20212004
self,

pandas-stubs/core/generic.pyi

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ from pandas._typing import (
5757
TimedeltaConvertibleTypes,
5858
TimeGrouperOrigin,
5959
TimestampConvertibleTypes,
60-
ToTimestampHow,
6160
WriteBuffer,
6261
)
6362

@@ -182,14 +181,14 @@ class NDFrame(indexing.IndexingMixin):
182181
self,
183182
path: FilePath | WriteBuffer[bytes],
184183
compression: CompressionOptions = "infer",
185-
protocol: int = ...,
184+
protocol: int = 5,
186185
storage_options: StorageOptions = ...,
187186
) -> None: ...
188187
@final
189188
def to_clipboard(
190189
self,
191190
excel: _bool = True,
192-
sep: _str | None = "\t",
191+
sep: _str | None = None,
193192
*,
194193
na_rep: _str = ...,
195194
float_format: _str | Callable[[object], _str] | None = ...,
@@ -413,8 +412,8 @@ class NDFrame(indexing.IndexingMixin):
413412
infer_objects: _bool = True,
414413
convert_string: _bool = True,
415414
convert_integer: _bool = True,
416-
convert_boolean: _bool = ...,
417-
convert_floating: _bool = ...,
415+
convert_boolean: _bool = True,
416+
convert_floating: _bool = True,
418417
dtype_backend: DtypeBackend = "numpy_nullable",
419418
) -> Self: ...
420419
@final
@@ -424,10 +423,8 @@ class NDFrame(indexing.IndexingMixin):
424423
axis: Axis | _NoDefaultDoNotUse = 0,
425424
closed: Literal["right", "left"] | None = None,
426425
label: Literal["right", "left"] | None = None,
427-
convention: ToTimestampHow = "start",
428-
kind: Literal["period", "timestamp"] | None = None,
429-
on: Level | None = ...,
430-
level: Level | None = ...,
426+
on: Level | None = None,
427+
level: Level | None = None,
431428
origin: TimeGrouperOrigin | TimestampConvertibleTypes = "start_day",
432429
offset: TimedeltaConvertibleTypes | None = None,
433430
group_keys: _bool = False,

0 commit comments

Comments
 (0)