Skip to content

Consider using partial loading for config schemas #1105

@llucax

Description

@llucax

What's needed?

When loading a config, if one field doesn't pass validation, then the whole config object is not created. This means that if only one field is wrong, but many other are OK, the whole update won't be done, when it could have been possible to load the fields that were valid and only keep the invalid field with the outdated value.

Proposed solution

Use marshmallow partial loading.

Use cases

No response

Alternatives and workarounds

No response

Additional context

We need to see if marshmallow_dataclass supports this, and how would this play with the type system, as if, for example, one required value is now not present in the config, the types won't match. One possible solution would be to return partially loaded configs as raw dicts instead of a class, but that will make dealing with config updates much more complicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:configAffects the configuration managementtype:enhancementNew feature or enhancement visitble to users

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions