Skip to content

Fix type hints for interval and span_range to accept Arrow objects#1262

Open
wavebyrd wants to merge 1 commit intoarrow-py:masterfrom
wavebyrd:fix/1210-interval-type-hints
Open

Fix type hints for interval and span_range to accept Arrow objects#1262
wavebyrd wants to merge 1 commit intoarrow-py:masterfrom
wavebyrd:fix/1210-interval-type-hints

Conversation

@wavebyrd
Copy link

Summary

  • Updates the type hints for start and end parameters in Arrow.interval() and Arrow.span_range() to Union["Arrow", dt_datetime]
  • This makes the type hints match the documented behavior and be consistent with Arrow.range() which already has the correct type hints

Changes

  • Arrow.interval(): Changed start and end from dt_datetime to Union["Arrow", dt_datetime]
  • Arrow.span_range(): Changed start and end from dt_datetime to Union["Arrow", dt_datetime]

Test plan

  • Module imports correctly
  • Type hints now accurately reflect the documented API behavior

Fixes #1210

🤖 Generated with Claude Code

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 arrow-py#1210

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b423717) to head (aa3aeba).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1262   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2315           
  Branches       358       358           
=========================================
  Hits          2315      2315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wavebyrd
Copy link
Author

Ping on this fold kwarg addition for DST disambiguation. Let me know if any changes needed!

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