-
-
Notifications
You must be signed in to change notification settings - Fork 699
Open
Labels
Description
Issue Description
Currently, footprint for Arrow.interval is:
def interval(
cls,
frame: _T_FRAMES,
start: dt_datetime,
end: dt_datetime,
interval: int = 1,
tz: Optional[TZ_EXPR] = None,
bounds: _BOUNDS = "[)",
exact: bool = False,
) -> Iterable[Tuple["Arrow", "Arrow"]]:Despite the fact that start and end arguments have type dt_datetime (which is datetime.datetime) however, both of them accept Arrow objects, which, looking down the line, makes sense, as the only properties of these arguments that are used are shared between Arrow and dt_datetime and (see fromdatetime method).
Thus, i believe it would make sense to change type hints for both arguments to the union of Arrow and dt_datetime:
def interval(
cls,
frame: _T_FRAMES,
start: "Arrow" | dt_datetime,
end: "Arrow" | dt_datetime,
interval: int = 1,
tz: Optional[TZ_EXPR] = None,
bounds: _BOUNDS = "[)",
exact: bool = False,
) -> Iterable[Tuple["Arrow", "Arrow"]]:System Info
- 🖥 OS name and version: Windows 24H2 26100.3476
- 🐍 Python version: 3.10.11
- 🏹 Arrow version: 1.3.0