Schema validation is not called when an argument is missing
A check inside a catch exception inhibit the rest of the validation
https://gitlab.esrf.fr/ui/daiquiri/-/blob/main/daiquiri/core/schema/init.py?ref_type=heads#L290
The error i receive is just that something is missing.
{'dataset_name': ['Missing data for required field.']}
As result calculated params are not generated.
I suggest to rewrite it this way.
def validate_func(func_name):
if hasattr(sch, k):
try:
validated[k] = getattr(sch, k)(data)
except Exception as e:
logger.debug(f"{k} failed with: {e}", exc_info=True)
try:
sch.load(data, unknown=INCLUDE)
except ValidationError as err:
if "_schema" in err.messages:
validated["errors"] = {"schema": err.messages["_schema"]}
validate_func("calculated")
validate_func("warnings")
if len(validated["errors"]) == 0:
validate_func("time_estimate")
What do you think @sfisher
Edited by Valentin Valls