From 8c1382b1a1833df48b8ebbced359d99e67de9130 Mon Sep 17 00:00:00 2001 From: Inzamul Hoque Date: Sun, 5 Oct 2025 00:32:03 +0530 Subject: [PATCH 1/2] fix: Added type hint for start and end datetime for interval --- arrow/arrow.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arrow/arrow.py b/arrow/arrow.py index d40927ed..037a91aa 100644 --- a/arrow/arrow.py +++ b/arrow/arrow.py @@ -299,7 +299,9 @@ def utcfromtimestamp(cls, timestamp: Union[int, float, str]) -> "Arrow": ) @classmethod - def fromdatetime(cls, dt: dt_datetime, tzinfo: Optional[TZ_EXPR] = None) -> "Arrow": + def fromdatetime( + cls, dt: Union["Arrow", dt_datetime], tzinfo: Optional[TZ_EXPR] = None + ) -> "Arrow": """Constructs an :class:`Arrow ` object from a ``datetime`` and optional replacement timezone. @@ -643,8 +645,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 +727,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 = "[)", From 5df496e8a9f58e0011abdc004187d46cbee54684 Mon Sep 17 00:00:00 2001 From: Inzamul Hoque Date: Sun, 5 Oct 2025 00:35:09 +0530 Subject: [PATCH 2/2] Fix: updated docstring --- arrow/arrow.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arrow/arrow.py b/arrow/arrow.py index 037a91aa..c62fd5f3 100644 --- a/arrow/arrow.py +++ b/arrow/arrow.py @@ -738,8 +738,8 @@ def interval( representing a series of intervals between two inputs. :param frame: The timeframe. Can be any ``datetime`` property (day, hour, minute...). - :param start: A datetime expression, the start of the range. - :param end: (optional) A datetime expression, the end of the range. + :param start: A datetime or Arrow expression, the start of the range. + :param end: (optional) A datetime or Arrow expression, the end of the range. :param interval: (optional) Time interval for the given time frame. :param tz: (optional) A timezone expression. Defaults to UTC. :param bounds: (optional) a ``str`` of either '()', '(]', '[)', or '[]' that specifies