Skip to content

Commit 95942f6

Browse files
author
Johannes Rueschel
committed
fix: Back to shallow merge of vars
1 parent 2a1af29 commit 95942f6

File tree

2 files changed

+2
-207
lines changed

2 files changed

+2
-207
lines changed

pydantic_settings/sources/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pydantic._internal._typing_extra import ( # type: ignore[attr-defined]
1414
get_origin,
1515
)
16-
from pydantic._internal._utils import deep_update, is_model_class
16+
from pydantic._internal._utils import is_model_class
1717
from pydantic.fields import FieldInfo
1818
from typing_extensions import get_args
1919
from typing_inspection import typing_objects
@@ -202,9 +202,7 @@ def _read_files(self, files: PathType | None) -> dict[str, Any]:
202202
for file in files:
203203
file_path = Path(file).expanduser()
204204
if file_path.is_file():
205-
file_data = self._read_file(file_path)
206-
# Deep merge so later files override earlier nested keys instead of replacing whole objects
207-
vars = deep_update(vars, file_data)
205+
vars.update(self._read_file(file_path))
208206
return vars
209207

210208
@abstractmethod

tests/test_config_file_deep_merge.py

Lines changed: 0 additions & 203 deletions
This file was deleted.

0 commit comments

Comments
 (0)