arrow-py / arrow

🏹 Better dates & times for Python
https://arrow.readthedocs.io
Apache License 2.0
8.63k stars 669 forks source link

Change span_range typehint to allow Arrow #1149

Open laundmo opened 1 year ago

laundmo commented 1 year ago

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

No tests were added as no behaviour was changed (only typehints)

Description of Changes

Changes the type hints of Arrow.span_range to correctly indicate it can also be called on Arrow objects.

To pass mypy, the type hints of fromdatetime also had to be changed to indicate it also works with Arrow objects.

Closes: #987

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (522a65b) 100.00% compared to head (a13fa68) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1149 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 10 10 Lines 2326 2326 Branches 400 400 ========================================= Hits 2326 2326 ``` | [Files](https://app.codecov.io/gh/arrow-py/arrow/pull/1149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py) | Coverage Δ | | |---|---|---| | [arrow/arrow.py](https://app.codecov.io/gh/arrow-py/arrow/pull/1149?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=arrow-py#diff-YXJyb3cvYXJyb3cucHk=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.