Skip to content

Fix constructor overloads for get and ArrowFactory.get - #1404

Open
Sskift wants to merge 1 commit into
arrow-py:masterfrom
Sskift:fix/get-constructor-overloads
Open

Sskift wants to merge 1 commit into
arrow-py:masterfrom
Sskift:fix/get-constructor-overloads

Conversation

@Sskift

@Sskift Sskift commented Nov 2, 2026

Copy link
Copy Markdown

Pull Request Checklist

  • Added tests for changed code.
  • All tests pass locally.
  • All linting checks pass locally.
  • Updated documentation for changed code.
  • Code is up-to-date with master.

Description of Changes

Constructor-style calls such as ArrowFactory().get(2024, 6, 1) and arrow.get(year=2024, month=6, day=1) work at runtime but fail type checking because the corresponding overloads are missing. Add a constructor overload to each public entry point, covering positional and keyword date fields, optional time fields, timezone and fold. Existing overloads and runtime behavior are unchanged.

Add static regression checks to the existing mypy hook. Eleven supported calls fail before the change and pass after it; incomplete dates and string day values remain rejected. The fixture is explicitly enabled in the mypy configuration because other test modules skip type errors.

Validation on Windows with Python 3.12:

  • Static regression fixture passes mypy; all 12 supported calls also execute successfully.
  • Full suite: 1,901 passed, 1 skipped; 99.93% coverage.
  • All pre-commit hooks and the warnings-as-errors Sphinx build pass.

No documentation update is needed: these constructor forms are already supported and documented. This change was developed with OpenAI Codex.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (2e3d954).
✅ All tests successful. No failed tests found.

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

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

This branch has not been deployed

No deployments
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.

1 participant