From aa3aeba6067a703f6c7d47b646053231586e82d1 Mon Sep 17 00:00:00 2001 From: wavebyrd Date: Sat, 14 Mar 2026 18:36:28 -0400 Subject: [PATCH] Fix type hints for interval and span_range to accept Arrow objects Updates the type hints for start and end parameters in Arrow.interval() and Arrow.span_range() to Union["Arrow", dt_datetime] to match the documented behavior and be consistent with Arrow.range(). Fixes #1210 Co-Authored-By: Claude Opus 4.5 --- arrow/arrow.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arrow/arrow.py b/arrow/arrow.py index f0a57f04..c0a4e25e 100644 --- a/arrow/arrow.py +++ b/arrow/arrow.py @@ -643,8 +643,8 @@ def ceil(self, frame: _T_FRAMES, **kwargs: Any) -> "Arrow": def span_range( cls, frame: _T_FRAMES, - start: dt_datetime, - end: dt_datetime, + start: Union["Arrow", dt_datetime], + end: Union["Arrow", dt_datetime], tz: Optional[TZ_EXPR] = None, limit: Optional[int] = None, bounds: _BOUNDS = "[)", @@ -725,8 +725,8 @@ def span_range( def interval( cls, frame: _T_FRAMES, - start: dt_datetime, - end: dt_datetime, + start: Union["Arrow", dt_datetime], + end: Union["Arrow", dt_datetime], interval: int = 1, tz: Optional[TZ_EXPR] = None, bounds: _BOUNDS = "[)",