Skip to content

fix(types): use Union[Arrow, dt_datetime] for span_range and interval start/end params - #1342

Open
juliosuas wants to merge 1 commit into
arrow-py:masterfrom
juliosuas:fix/span-range-interval-type-hints
Open

fix(types): use Union[Arrow, dt_datetime] for span_range and interval start/end params#1342
juliosuas wants to merge 1 commit into
arrow-py:masterfrom
juliosuas:fix/span-range-interval-type-hints

Conversation

@juliosuas

Copy link
Copy Markdown

Fixes #1210.

Arrow.span_range() and Arrow.interval() accept start and end bounds like
Arrow.range() does, but their annotations only allowed datetime.

This updates those annotations to accept Arrow | datetime and normalizes
Arrow bounds before passing them through fromdatetime().

The test dependency markers also skip two optional test-only dependencies on
Windows PyPy. The affected dateparser regression test already uses
pytest.importorskip("dateparser"), and pre-commit is only needed by the
lint environment.

Tests:

tox -e lint
tox -e py314

Restored after an accidental fork deletion. Same commits as #1267.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type hints for Arrow.interval should show Arrow as possible type for start and end arguments

1 participant