Skip to content

Commit 794948a

Browse files
authored
to_datetime's utc is not documented to allow None (#762)
1 parent 8957328 commit 794948a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pandas-stubs/core/tools/datetimes.pyi

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def to_datetime(
4343
errors: IgnoreRaise = ...,
4444
dayfirst: bool = ...,
4545
yearfirst: bool = ...,
46-
utc: bool | None = ...,
46+
utc: bool = ...,
4747
format: str | None = ...,
4848
exact: bool = ...,
4949
unit: str | None = ...,
@@ -57,7 +57,7 @@ def to_datetime(
5757
errors: Literal["coerce"],
5858
dayfirst: bool = ...,
5959
yearfirst: bool = ...,
60-
utc: bool | None = ...,
60+
utc: bool = ...,
6161
format: str | None = ...,
6262
exact: bool = ...,
6363
unit: str | None = ...,
@@ -71,7 +71,7 @@ def to_datetime(
7171
errors: IgnoreRaiseCoerce = ...,
7272
dayfirst: bool = ...,
7373
yearfirst: bool = ...,
74-
utc: bool | None = ...,
74+
utc: bool = ...,
7575
format: str | None = ...,
7676
exact: bool = ...,
7777
unit: str | None = ...,
@@ -92,7 +92,7 @@ def to_datetime(
9292
errors: IgnoreRaiseCoerce = ...,
9393
dayfirst: bool = ...,
9494
yearfirst: bool = ...,
95-
utc: bool | None = ...,
95+
utc: bool = ...,
9696
format: str | None = ...,
9797
exact: bool = ...,
9898
unit: str | None = ...,

tests/test_pandas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_types_to_datetime() -> None:
3434

3535
r2: pd.Series = pd.to_datetime(df, unit="s", origin="unix")
3636
r3: pd.Series = pd.to_datetime(
37-
df, unit="ns", dayfirst=True, utc=None, format="%M:%D", exact=False
37+
df, unit="ns", dayfirst=True, utc=False, format="%M:%D", exact=False
3838
)
3939
r4: pd.DatetimeIndex = pd.to_datetime(
4040
[1, 2], unit="D", origin=pd.Timestamp("01/01/2000")

0 commit comments

Comments
 (0)