Skip to content

Commit 4773e3c

Browse files
committed
feat: add populate_by_name option to BaseCustomSettings for compatibility with pydantic v2.11+
feat: include `POSTGRES_CLIENT_NAME` as a validation alias in `PostgresSettings`
1 parent 6eb6a3d commit 4773e3c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/settings-library/src/settings_library/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def _parse_none(cls, v, info: ValidationInfo):
123123
extra="ignore",
124124
frozen=True,
125125
ignored_types=(cached_property,),
126+
populate_by_name=True, # deprecated in pydantic v2.11+
126127
validate_by_alias=True,
127128
validate_by_name=True,
128129
validate_default=True,

packages/settings-library/src/settings_library/postgres.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class PostgresSettings(BaseCustomSettings):
4343
description="Name of the application connecting the postgres database, will default to use the host hostname (hostname on linux)",
4444
validation_alias=AliasChoices(
4545
# This is useful when running inside a docker container, then the hostname is set each client gets a different name
46+
"POSTGRES_CLIENT_NAME",
4647
"HOST",
4748
"HOSTNAME",
4849
),

0 commit comments

Comments
 (0)