You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The value of a queryable is set as its default value even if it is not allowed. We can get this case when a parameter is neither in default parameter of the product type configuration of a provider nor in a potencial constraints file of the provider. We can then find this parameter in a queryables form, and values of this parameter are already taken in eodag in values variable in queryables_by_form().
Code To Reproduce
In ERA5_PL default parameters configuration of cop_cds configuration, remove "ecmwf:download_format": zip. Then, run the following code:
Output
typing.Annotated[typing.Literal['unarchived', 'zip'], FieldInfo(annotation=NoneType, required=False, default='unarchivedddd', title='Download format', description="If you select 'Zip' the files will always be zipped into a single file. <br><br> If you select 'Unarchived' then the files will be returned unzipped if there is only one file, and zipped if there are multiple files. <br><br> Please note that in some circumstances the conversion from GRIB to NetCDF can result in multiple files.")]
Environment:
Python version: 3.12.3
EODAG version: 3.0.0b4.dev121+g7c92c3a7
Additional context
A avenue to go throught this issue is:
# check if default value is allowedif (default:=defaults.get(name)) anddefaultnotinvalues:
raiseValidationError(
f"ecmwf:{name}={default} is not allowed. "f"Allowed values are {', '.join(values)}."
)
values variable may be a list containing the values needed (for exemple for year queryable), then a processing of this variable has to be done.
The text was updated successfully, but these errors were encountered:
Describe the bug
The value of a queryable is set as its default value even if it is not allowed. We can get this case when a parameter is neither in default parameter of the product type configuration of a provider nor in a potencial constraints file of the provider. We can then find this parameter in a queryables form, and values of this parameter are already taken in eodag in
values
variable inqueryables_by_form()
.Code To Reproduce
In
ERA5_PL
default parameters configuration ofcop_cds
configuration, remove"ecmwf:download_format": zip
. Then, run the following code:Output
typing.Annotated[typing.Literal['unarchived', 'zip'], FieldInfo(annotation=NoneType, required=False, default='unarchivedddd', title='Download format', description="If you select 'Zip' the files will always be zipped into a single file. <br><br> If you select 'Unarchived' then the files will be returned unzipped if there is only one file, and zipped if there are multiple files. <br><br> Please note that in some circumstances the conversion from GRIB to NetCDF can result in multiple files.")]
Environment:
Additional context
A avenue to go throught this issue is:
values
variable may be a list containing the values needed (for exemple foryear
queryable), then a processing of this variable has to be done.The text was updated successfully, but these errors were encountered: