File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/common-library/src/common_library Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,11 @@ def model_dump_with_secrets(
3030 data [field_name ] = str (field_data )
3131
3232 elif isinstance (field_data , dict ):
33- field_type = settings_obj .model_fields [field_name ].annotation
33+ possible_pydantic_model = settings_obj .model_fields [field_name ].annotation
34+ # NOTE: data could be a dict which does not represent a pydantic model or a union of models
3435 with contextlib .suppress (AttributeError , ValidationError ):
3536 data [field_name ] = model_dump_with_secrets (
36- TypeAdapter (field_type ).validate_python (field_data ),
37+ TypeAdapter (possible_pydantic_model ).validate_python (field_data ),
3738 show_secrets = show_secrets ,
3839 ** pydantic_export_options ,
3940 )
You can’t perform that action at this time.
0 commit comments