Skip to content

Fix CLI parsing error for set field types since 2.13.0 (#787)#788

Merged
hramezani merged 1 commit intomainfrom
fix/cli-set-type-subscript-error
Feb 18, 2026
Merged

Fix CLI parsing error for set field types since 2.13.0 (#787)#788
hramezani merged 1 commit intomainfrom
fix/cli-set-type-subscript-error

Conversation

@hramezani
Copy link
Copy Markdown
Member

@hramezani hramezani commented Feb 17, 2026

Fixes #787

Summary

  • Fix SettingsError: 'set' object is not subscriptable when using set[str] or set[int] fields with cli_parse_args=True
  • The numeric type coercion added in CLI coerce numeric types. #769 used [0] to index the result of validate_python, which fails for set types since sets are not subscriptable
  • Use next(iter(...)) instead which works for any iterable (lists, sets, frozensets, etc.)

Test plan

  • Added test_cli_set_arg covering set[str] and set[int] CLI argument parsing
  • All 166 CLI tests pass
  • make format clean

🤖 Generated with Claude Code

@hramezani hramezani force-pushed the fix/cli-set-type-subscript-error branch from 546b2a4 to 71c6892 Compare February 17, 2026 18:20
The numeric type coercion added in #769 used `[0]` to index the result
of `validate_python`, which fails for `set` types since sets are not
subscriptable. Use `next(iter(...))` instead which works for any iterable.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@hramezani hramezani force-pushed the fix/cli-set-type-subscript-error branch from 71c6892 to 7475ae5 Compare February 17, 2026 18:22
@hramezani hramezani changed the title Fix CLI regression for set field types since 2.13.0 Fix CLI parsing error for set field types since 2.13.0 (#787) Feb 17, 2026
@hramezani hramezani merged commit 4933f06 into main Feb 18, 2026
19 checks passed
@hramezani hramezani deleted the fix/cli-set-type-subscript-error branch February 18, 2026 08:17
@hramezani hramezani mentioned this pull request Feb 19, 2026
2 tasks
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.

SettingsError with nested command line args in version 2.13.0

1 participant