Skip to content

Commit 9f5f3f2

Browse files
authored
Merge branch 'main' into support-cli-aliases
2 parents f9c116c + e162908 commit 9f5f3f2

File tree

3 files changed

+359
-352
lines changed

3 files changed

+359
-352
lines changed

pydantic_settings/sources/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ class Settings(BaseSettings):
426426
values[name] = value
427427
continue
428428

429-
if _lenient_issubclass(sub_model_field.annotation, BaseModel) and isinstance(value, dict):
429+
if (
430+
sub_model_field is not None
431+
and _lenient_issubclass(sub_model_field.annotation, BaseModel)
432+
and isinstance(value, dict)
433+
):
430434
values[field_key] = self._replace_field_names_case_insensitively(sub_model_field, value)
431435
else:
432436
values[field_key] = value

pydantic_settings/sources/providers/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def parse_args_insensitive_method(
599599
if matched:
600600
arg = matched.group(1).lower() + matched.group(2)
601601
insensitive_args.append(arg)
602-
return parser_method(root_parser, insensitive_args, namespace) # type: ignore
602+
return parser_method(root_parser, insensitive_args, namespace)
603603

604604
return parse_args_insensitive_method
605605

0 commit comments

Comments
 (0)