@@ -350,7 +350,9 @@ def __call__(self) -> dict[str, Any]:
350
350
return self .defaults
351
351
352
352
def __repr__ (self ) -> str :
353
- return f'DefaultSettingsSource(nested_model_default_partial_update={ self .nested_model_default_partial_update } )'
353
+ return (
354
+ f'{ self .__class__ .__name__ } (nested_model_default_partial_update={ self .nested_model_default_partial_update } )'
355
+ )
354
356
355
357
356
358
class InitSettingsSource (PydanticBaseSettingsSource ):
@@ -384,7 +386,7 @@ def __call__(self) -> dict[str, Any]:
384
386
)
385
387
386
388
def __repr__ (self ) -> str :
387
- return f'InitSettingsSource (init_kwargs={ self .init_kwargs !r} )'
389
+ return f'{ self . __class__ . __name__ } (init_kwargs={ self .init_kwargs !r} )'
388
390
389
391
390
392
class PydanticBaseEnvSettingsSource (PydanticBaseSettingsSource ):
@@ -674,7 +676,7 @@ def get_field_value(self, field: FieldInfo, field_name: str) -> tuple[Any, str,
674
676
return None , field_key , value_is_complex
675
677
676
678
def __repr__ (self ) -> str :
677
- return f'SecretsSettingsSource (secrets_dir={ self .secrets_dir !r} )'
679
+ return f'{ self . __class__ . __name__ } (secrets_dir={ self .secrets_dir !r} )'
678
680
679
681
680
682
class EnvSettingsSource (PydanticBaseEnvSettingsSource ):
@@ -899,7 +901,7 @@ def explode_env_vars(self, field_name: str, field: FieldInfo, env_vars: Mapping[
899
901
900
902
def __repr__ (self ) -> str :
901
903
return (
902
- f'EnvSettingsSource (env_nested_delimiter={ self .env_nested_delimiter !r} , '
904
+ f'{ self . __class__ . __name__ } (env_nested_delimiter={ self .env_nested_delimiter !r} , '
903
905
f'env_prefix_len={ self .env_prefix_len !r} )'
904
906
)
905
907
@@ -1015,7 +1017,7 @@ def __call__(self) -> dict[str, Any]:
1015
1017
1016
1018
def __repr__ (self ) -> str :
1017
1019
return (
1018
- f'DotEnvSettingsSource (env_file={ self .env_file !r} , env_file_encoding={ self .env_file_encoding !r} , '
1020
+ f'{ self . __class__ . __name__ } (env_file={ self .env_file !r} , env_file_encoding={ self .env_file_encoding !r} , '
1019
1021
f'env_nested_delimiter={ self .env_nested_delimiter !r} , env_prefix_len={ self .env_prefix_len !r} )'
1020
1022
)
1021
1023
@@ -1919,6 +1921,9 @@ def _read_file(self, file_path: Path) -> dict[str, Any]:
1919
1921
with open (file_path , encoding = self .json_file_encoding ) as json_file :
1920
1922
return json .load (json_file )
1921
1923
1924
+ def __repr__ (self ) -> str :
1925
+ return f'{ self .__class__ .__name__ } (json_file={ self .json_file_path } )'
1926
+
1922
1927
1923
1928
class TomlConfigSettingsSource (InitSettingsSource , ConfigFileSourceMixin ):
1924
1929
"""
@@ -1941,6 +1946,9 @@ def _read_file(self, file_path: Path) -> dict[str, Any]:
1941
1946
return tomli .load (toml_file )
1942
1947
return tomllib .load (toml_file )
1943
1948
1949
+ def __repr__ (self ) -> str :
1950
+ return f'{ self .__class__ .__name__ } (toml_file={ self .toml_file_path } )'
1951
+
1944
1952
1945
1953
class PyprojectTomlConfigSettingsSource (TomlConfigSettingsSource ):
1946
1954
"""
@@ -2013,6 +2021,9 @@ def _read_file(self, file_path: Path) -> dict[str, Any]:
2013
2021
with open (file_path , encoding = self .yaml_file_encoding ) as yaml_file :
2014
2022
return yaml .safe_load (yaml_file ) or {}
2015
2023
2024
+ def __repr__ (self ) -> str :
2025
+ return f'{ self .__class__ .__name__ } (yaml_file={ self .yaml_file_path } )'
2026
+
2016
2027
2017
2028
class AzureKeyVaultMapping (Mapping [str , Optional [str ]]):
2018
2029
_loaded_secrets : dict [str , str | None ]
@@ -2075,7 +2086,7 @@ def _load_env_vars(self) -> Mapping[str, Optional[str]]:
2075
2086
return AzureKeyVaultMapping (secret_client )
2076
2087
2077
2088
def __repr__ (self ) -> str :
2078
- return f'AzureKeyVaultSettingsSource (url={ self ._url !r} , ' f'env_nested_delimiter={ self .env_nested_delimiter !r} )'
2089
+ return f'{ self . __class__ . __name__ } (url={ self ._url !r} , ' f'env_nested_delimiter={ self .env_nested_delimiter !r} )'
2079
2090
2080
2091
2081
2092
def _get_env_var_key (key : str , case_sensitive : bool = False ) -> str :
0 commit comments