Skip to content

Commit d63f74b

Browse files
committed
Fix mypy errors
1 parent bb13620 commit d63f74b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
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
@@ -594,7 +594,7 @@ def parse_args_insensitive_method(
594594
if matched:
595595
arg = matched.group(1).lower() + matched.group(2)
596596
insensitive_args.append(arg)
597-
return parser_method(root_parser, insensitive_args, namespace) # type: ignore
597+
return parser_method(root_parser, insensitive_args, namespace)
598598

599599
return parse_args_insensitive_method
600600

0 commit comments

Comments
 (0)