Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <arrow.arrow.Arrow>` object from a ``datetime`` and
optional replacement timezone.

Expand Down Expand Up @@ -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 = "[)",
Expand Down Expand Up @@ -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 = "[)",
Expand All @@ -736,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.
Comment on lines -740 to +742
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test case using the Arrow object - are we properly handling it in the body?

: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
Expand Down
Loading