Skip to content

Conversation

@Digity101
Copy link
Contributor

see #701

elif field_name.endswith(':subcommand') and val is not None:
selected_subcommands.append(self._parser_map[field_name][val].dest)
elif self.cli_kebab_case == 'all':
if isinstance(val, bool):
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of making it specific to bool, can you update to exclude above on str. e.g.

elif self.cli_kebab_case == 'all' and isinstance(val, str):

All of the logic in this case assumes val is str. Thanks for the catch 👍🏾

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change is indeed better. When I wrote the bug fix, I didn't pay much attention to possible types of val and took the easy way out.

@kschwab
Copy link
Contributor

kschwab commented Nov 25, 2025

Thanks @Digity101 for the fix! @hramezani looks good to me.

@hramezani
Copy link
Member

Thanks all!

@hramezani hramezani merged commit 11c6db2 into pydantic:main Nov 25, 2025
19 checks passed
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.

3 participants