File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/settings-library/tests Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1515from pydantic import ValidationInfo , field_validator
1616from pydantic .fields import PydanticUndefined
1717from 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
2121def 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
You can’t perform that action at this time.
0 commit comments