Skip to content

Fix validation of empty frame names - #1403

Open
Sskift wants to merge 1 commit into
arrow-py:masterfrom
Sskift:fix/empty-frame-validation
Open

Sskift wants to merge 1 commit into
arrow-py:masterfrom
Sskift:fix/empty-frame-validation

Conversation

@Sskift

@Sskift Sskift commented Nov 2, 2026

Copy link
Copy Markdown

Pull Request Checklist

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

Description of Changes

Passing an empty frame to Arrow.range() or Arrow.span() raises IndexError while other unsupported frames raise ValueError with the list of supported frames. Use endswith() when checking plural frame names so the empty string reaches that existing validation error. This also applies to floor(), ceil(), span_range(), and interval(), which use the same frame validation.

The existing invalid-frame tests now cover empty strings as well. The full suite passed on Windows with Python 3.12: 1,903 passed, 1 skipped, with 99.93% coverage. All pre-commit hooks and the documentation build passed. No documentation change is needed for this validation correction.

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 (a30c425).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1403   +/-   ##
=========================================
  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