You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in dates is DatetimeIndex(['2024-03-19', '2024-03-19'], dtype='datetime64[ns]', freq=None)
But mypy returns:
# mypy test.py
test.py:5: error: Incompatible types in assignment (expression has type"DatetimeIndex", variable has type"list[date]") [assignment]
test.py:5: error: Argument 1 to "to_datetime" has incompatible type"list[date]"; expected "Sequence[float | datetime] | list[str] | tuple[float | str | datetime, ...] | ndarray[Any, dtype[datetime64]] | ndarray[Any, dtype[str_]] | ndarray[Any, dtype[signedinteger[Any]]] | Index[Any] | ExtensionArray" [arg-type]
Found 2 errors in 1 file (checked 1 source file)
Please complete the following information:
OS: Linux Ubuntu 22.04.4 LTS x86_64
python version 3.10.13
version of type checker: mypy 1.7.1 (compiled: yes)
version of installed pandas-stubs: 2.2.0.240218
pandas 2.2.1
The text was updated successfully, but these errors were encountered:
vanheck
changed the title
pd.to_datetime(list[datetime.date]) is wrong input, but pandas returns output.
pd.to_datetime(list[datetime.date]) is wrong input (mypy), but pandas returns output.
Mar 19, 2024
vanheck
changed the title
pd.to_datetime(list[datetime.date]) is wrong input (mypy), but pandas returns output.
pd.to_datetime(list[datetime.date]) is wrong input type (mypy), but pandas returns output.
Mar 19, 2024
Describe the bug
datetime.date
is a valid type as a function parameter, but mypy raises errorsTo Reproduce
test.py
file:in dates is
DatetimeIndex(['2024-03-19', '2024-03-19'], dtype='datetime64[ns]', freq=None)
But mypy returns:
Please complete the following information:
pandas-stubs
: 2.2.0.240218The text was updated successfully, but these errors were encountered: