From ffeb1f4de2ca1b54a9066fc637cce40ab7ac1e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Sat, 5 Aug 2023 10:41:47 -0400 Subject: [PATCH] to_datetime's utc is not documented to allow None --- pandas-stubs/core/tools/datetimes.pyi | 8 ++++---- tests/test_pandas.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas-stubs/core/tools/datetimes.pyi b/pandas-stubs/core/tools/datetimes.pyi index 6d788a64c..677a1b3dc 100644 --- a/pandas-stubs/core/tools/datetimes.pyi +++ b/pandas-stubs/core/tools/datetimes.pyi @@ -43,7 +43,7 @@ def to_datetime( errors: IgnoreRaise = ..., dayfirst: bool = ..., yearfirst: bool = ..., - utc: bool | None = ..., + utc: bool = ..., format: str | None = ..., exact: bool = ..., unit: str | None = ..., @@ -57,7 +57,7 @@ def to_datetime( errors: Literal["coerce"], dayfirst: bool = ..., yearfirst: bool = ..., - utc: bool | None = ..., + utc: bool = ..., format: str | None = ..., exact: bool = ..., unit: str | None = ..., @@ -71,7 +71,7 @@ def to_datetime( errors: IgnoreRaiseCoerce = ..., dayfirst: bool = ..., yearfirst: bool = ..., - utc: bool | None = ..., + utc: bool = ..., format: str | None = ..., exact: bool = ..., unit: str | None = ..., @@ -92,7 +92,7 @@ def to_datetime( errors: IgnoreRaiseCoerce = ..., dayfirst: bool = ..., yearfirst: bool = ..., - utc: bool | None = ..., + utc: bool = ..., format: str | None = ..., exact: bool = ..., unit: str | None = ..., diff --git a/tests/test_pandas.py b/tests/test_pandas.py index 401fc1aa1..20740a260 100644 --- a/tests/test_pandas.py +++ b/tests/test_pandas.py @@ -34,7 +34,7 @@ def test_types_to_datetime() -> None: r2: pd.Series = pd.to_datetime(df, unit="s", origin="unix") r3: pd.Series = pd.to_datetime( - df, unit="ns", dayfirst=True, utc=None, format="%M:%D", exact=False + df, unit="ns", dayfirst=True, utc=False, format="%M:%D", exact=False ) r4: pd.DatetimeIndex = pd.to_datetime( [1, 2], unit="D", origin=pd.Timestamp("01/01/2000")