fix(queryables): required parameters, defaults and allowed combinations#2148
Conversation
Test Results 4 files ± 0 4 suites ±0 4m 10s ⏱️ -3s Results for commit b55eaa7. ± Comparison against base commit e0d1058. This pull request removes 2 and adds 23 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Code Coverage (Ubuntu)DetailsDiff against developResults for commit: 503d2da Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Code Coverage (Windows)DetailsDiff against developResults for commit: 9d5a631 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
4018d34 to
b243936
Compare
For the first case, things are confusing. The error raised is: But >>> dag.list_queryables(**params)["ecmwf_level"]
typing.Annotated[list, FieldInfo(annotation=NoneType, required=False, default=None, alias_priority=2, validation_alias=AliasChoices(choices=['ecmwf:level', 'level']), serialization_alias='ecmwf:level', title='Level')] |
sbrunato
left a comment
There was a problem hiding this comment.
please remove the not-allowed parameter from queryables, and add a test for this new mechanism
e116476 to
503d2da
Compare
503d2da to
abce4eb
Compare
Benchmark comparisonCompared baseline: |
Code Coverage (Ubuntu)DetailsDiff against developResults for commit: b55eaa7 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Code Coverage (Windows)DetailsDiff against developResults for commit: b55eaa7 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
More precisely: allow any value if the keyword not required by form and the list of allowed values is empty.
bdf930e to
193cfe7
Compare
- an input keyword cannot be used if it's required by form and no constraint with the given combination of parameters exists; - any value is accepted if a keyword is not required by form and its list of allowed values is empty; - a queryable with a default value must use that default value and being not required; - a not allowed parameter must not be listed in the queryables.
4122ae7 to
0616b82
Compare
This PR is fixing how the queryables are calculated from provider form file.
Queryables available values
If no constraint is matching a given parameter, then look at the form file:
In the latter case, there may be no constraint at all containing that keyword because any value is anyway accepted.
Queryables by form
Test