Skip to content

Commit 9c4e07e

Browse files
fix import
1 parent 4c27843 commit 9c4e07e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/settings-library/tests/test__pydantic_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pydantic import ValidationInfo, field_validator
1616
from pydantic.fields import PydanticUndefined
1717
from pydantic_settings import BaseSettings
18-
from settings_library.base import _allows_none
18+
from models_library.utils.pydantic_fields_extension import is_nullable
1919

2020

2121
def assert_field_specs(
@@ -29,7 +29,7 @@ def assert_field_specs(
2929
print(info)
3030

3131
assert info.is_required() == is_required
32-
assert _allows_none(info) == is_nullable
32+
assert is_nullable(info) == is_nullable
3333

3434
if info.is_required():
3535
# in this case, default is not really used
@@ -55,7 +55,7 @@ class Settings(BaseSettings):
5555
@classmethod
5656
def parse_none(cls, v, info: ValidationInfo):
5757
# WARNING: In nullable fields, envs equal to null or none are parsed as None !!
58-
if info.field_name and _allows_none(cls.model_fields[info.field_name]):
58+
if info.field_name and is_nullable(cls.model_fields[info.field_name]):
5959
if isinstance(v, str) and v.lower() in ("null", "none"):
6060
return None
6161
return v

0 commit comments

Comments
 (0)