Skip to content

fix: treat oversized list indices as missing placeholder segments - #93

Merged
Bbenchaya merged 1 commit into
intuit:mainfrom
atishay-kasliwal:bugfix/91-oversized-index-fallback
Nov 23, 2026
Merged

Bbenchaya merged 1 commit into
intuit:mainfrom
atishay-kasliwal:bugfix/91-oversized-index-fallback

Conversation

@atishay-kasliwal

Copy link
Copy Markdown
Contributor

Checklist

  • I've read and agree to the project's contribution guidelines.
  • I'm requesting to pull a topic/feature/bugfix branch.
  • I checked that my code additions will pass code linting checks and unit tests.
  • I updated unit and integration tests (if applicable).
  • I added an [Unreleased] changelog entry for a user-visible change, or confirmed the change is exempt.
  • I'm ready to notify the team of this contribution.

Description

An all-decimal path segment longer than Python's integer-string conversion limit passes the isdecimal() check from #76, then raises ValueError from int(). The exception skips both the <path> marker and default(...).

_lookup_path now gets the index from a small _parse_index helper, which returns None for a segment that isn't a usable index, including one int() refuses. That takes the existing unresolved path, so the marker and default(...) work as they do for any other missing segment. The conversion limit itself isn't touched.

Tests cover input and config, with and without a default, on lists and tuples, plus normal indices and a Unicode decimal digit. The oversized index is max(sys.get_int_max_str_digits(), 4300) + 1 digits long, so the test holds under any configured limit. With the limit disabled the index converts and is out of range, which gives the same result.

Verified with uv run pytest (538 passed), ruff check, ruff format --check and mypy src/. tests/test_resolving.py also passes with PYTHONINTMAXSTRDIGITS=640 and =0. Reverting the resolving.py change makes the new list and tuple cases fail.

Fixes #91

An all-decimal segment longer than Python's integer-string conversion
limit passed the isdecimal() check and then raised ValueError from
int(), bypassing both the <path> marker and default(...).

Fixes intuit#91

Signed-off-by: Atishay Kasliwal <katishay@gmail.com>
@atishay-kasliwal

Copy link
Copy Markdown
Contributor Author

@Bbenchaya could you approve the CI runs on #93, #94 and #95? They're waiting on first-time contributor approval. Thanks

@atishay-kasliwal

Copy link
Copy Markdown
Contributor Author

@Bbenchaya Could you approve the CI runs for #93, #94 and #95 when you have a moment? All three still show action_required, so the tests haven't run yet. Thanks.

@Bbenchaya Bbenchaya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@Bbenchaya
Bbenchaya merged commit cacc983 into intuit:main Nov 23, 2026
7 checks passed

This branch was previously deployed

1 inactive deployment
pypi — 2adaae97 Deployed Nov 23, 2026 by Bbenchaya via Tag & Publish #53
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.

bug: oversized numeric placeholder indices raise instead of using the missing-value fallback

2 participants