Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use constraints for queryables #981

Merged
merged 62 commits into from Feb 19, 2024

Conversation

jlahovnik
Copy link
Collaborator

  • queryables are created based on constraints if constraints_file_url is given for a provider (currently only implemented for cop_ads/cop_cds, wekeo can be done as soon as it is updated to the new endpoint)
  • possible values are added to the queryables (if available)
  • queryable parameters can be added to the request, to get only values matching the given condition for other queryables

@jlahovnik jlahovnik linked an issue Jan 11, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Jan 11, 2024

Test Results

    4 files  ± 0      4 suites  ±0   4m 38s ⏱️ -1s
  462 tests + 5    459 ✅ + 5   3 💤 ±0  0 ❌ ±0 
1 848 runs  +20  1 766 ✅ +18  82 💤 +2  0 ❌ ±0 

Results for commit 11b12d0. ± Comparison against base commit 3323b91.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jan 11, 2024

Code Coverage (Ubuntu)

File Coverage
All files 81%

Minimum allowed coverage is 70%

Generated by 🐒 cobertura-action against 88a3f2e

Copy link
Contributor

github-actions bot commented Jan 11, 2024

Code Coverage (Windows)

File Coverage
All files 76%

Minimum allowed coverage is 70%

Generated by 🐒 cobertura-action against 88a3f2e

@jlahovnik jlahovnik marked this pull request as draft January 11, 2024 10:46
@jlahovnik jlahovnik self-assigned this Jan 11, 2024
@jlahovnik jlahovnik marked this pull request as ready for review January 11, 2024 11:18
@jlahovnik jlahovnik force-pushed the 954-use-constraints-for-queryables branch from 567a162 to 0ea7cbb Compare January 22, 2024 08:03
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/plugins/search/qssearch.py Outdated Show resolved Hide resolved
eodag/plugins/search/base.py Outdated Show resolved Hide resolved
eodag/plugins/apis/base.py Outdated Show resolved Hide resolved
eodag/api/core.py Outdated Show resolved Hide resolved
eodag/plugins/apis/cds.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
eodag/api/constraints.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@sbrunato sbrunato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please:

  • add a value attribute (from providers.yml default or given value) for returned queryables
    • this value should also be returned by lib methods, instead of actual default value
  • pre-filter queryables available values using default values
  • In datetime description, tell to refer to year, month, day contraints, if available
  • return ids and not id
  • return collections and not collection
  • return geometry and not bbox
  • add schema for geometry

@sbrunato sbrunato marked this pull request as draft January 23, 2024 08:42
@jlahovnik
Copy link
Collaborator Author

all change requests should be resolved

@jlahovnik jlahovnik marked this pull request as ready for review January 25, 2024 11:28
eodag/utils/constraints.py Outdated Show resolved Hide resolved
eodag/utils/constraints.py Outdated Show resolved Hide resolved
eodag/utils/constraints.py Outdated Show resolved Hide resolved
eodag/plugins/apis/cds.py Outdated Show resolved Hide resolved
eodag/api/core.py Outdated Show resolved Hide resolved
eodag/api/product/metadata_mapping.py Outdated Show resolved Hide resolved
eodag/plugins/apis/cds.py Outdated Show resolved Hide resolved
eodag/plugins/apis/cds.py Show resolved Hide resolved
eodag/rest/types/stac_queryables.py Outdated Show resolved Hide resolved
eodag/utils/constraints.py Outdated Show resolved Hide resolved
eodag/utils/constraints.py Outdated Show resolved Hide resolved
@sbrunato sbrunato marked this pull request as draft January 25, 2024 17:22
@jlahovnik
Copy link
Collaborator Author

all change requests implemented

@jlahovnik jlahovnik marked this pull request as ready for review January 26, 2024 11:54
@sbrunato sbrunato marked this pull request as draft January 26, 2024 18:25
@jlahovnik jlahovnik force-pushed the 954-use-constraints-for-queryables branch from ffa2c22 to 231bc43 Compare January 29, 2024 13:41
@jlahovnik jlahovnik marked this pull request as ready for review January 29, 2024 13:50
@jlahovnik
Copy link
Collaborator Author

branch rebased

Copy link
Collaborator

@sbrunato sbrunato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • when a parameter has a default value pre-configured, other available values are not listed, for example, on
    http://127.0.0.1:5000/collections/ERA5_SL/queryables?provider=cop_cds
    for api_product_type, we only reanalysis is listed, other values are missing
  • also we may be able to override defaults with given additional filters (giving an empty value, or None in library mode), in order to be able to list all combinations

@sbrunato sbrunato marked this pull request as draft January 29, 2024 18:58
@jlahovnik
Copy link
Collaborator Author

  • when a parameter has a default value pre-configured, other available values are not listed, for example, on
    http://127.0.0.1:5000/collections/ERA5_SL/queryables?provider=cop_cds
    for api_product_type, we only reanalysis is listed, other values are missing

    • also we may be able to override defaults with given additional filters (giving an empty value, or None in library mode), in order to be able to list all combinations

Defaults can now be removed by setting them to empty in the query params. In that case all the values of the parameter are no and no filtering by this parameter is applied.
About the first point: I kept this as it is for the moment because I think it might be confusing if we show all the values but the remaining parameters are filtered by one value. If the same constraints apply for several values, they are all shown.

@jlahovnik jlahovnik marked this pull request as ready for review January 31, 2024 16:07
@sbrunato sbrunato force-pushed the 954-use-constraints-for-queryables branch 2 times, most recently from 56c8be8 to f1e82c4 Compare February 19, 2024 14:26
@sbrunato sbrunato changed the title 954 use constraints for queryables feat: use constraints for queryables Feb 19, 2024
@sbrunato sbrunato force-pushed the 954-use-constraints-for-queryables branch from f1e82c4 to 11b12d0 Compare February 19, 2024 14:37
@sbrunato sbrunato merged commit fbfc7d0 into develop Feb 19, 2024
10 checks passed
@sbrunato sbrunato deleted the 954-use-constraints-for-queryables branch February 19, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use constraints for queryables
3 participants