Closed
Description
This example is bdate_range
, but I suspect this issue is spread more widely.
import pandas as pd
from typing import Optional
from datetime import date
a: Optional[date] = date(2022, 1, 1)
b: Optional[date] = date(2022, 1, 10)
dr = pd.bdate_range(a, b, freq="d")
error: Argument 2 to "bdate_range" has incompatible type "Optional[date]"; expected "Union[str, Union[datetime, datetime64, Timestamp], None]" [arg-type]
Tagging @bashtage as I think he's done some work around this recently. It seems to me that we may have made an assumption somewhere that date
is a subset of datetime
(it's actually the opposite).
Metadata
Metadata
Assignees
Labels
No labels