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: implement new core method get_queryables #917

Merged
merged 13 commits into from Dec 6, 2023
Merged

Conversation

dalpasso
Copy link
Collaborator

@dalpasso dalpasso commented Nov 8, 2023

Implements a new core method def get_queryables(provider=None, product_type=None) -> List[str]:

  • If no provider and no product_type are passed, then returns default search method queryable parameters: ["productType", "start", "end", "geom", "locations", "id"]
  • If a provider is passed (but no product_type), then returns its queryable parameters from provider's config
  • If a product_type is passed (but no provider), then return the intersection of the queryables of all the providers supporting it
  • If both a product_type and a provider are passed, then returns the queryable parameters from provider's config and the queryable parameters for that product type

The following exceptions are raised:

  • UnsupportedProvider() if the given provider is not found
  • UnsupportedProductType() if the given product_type is not found

@dalpasso dalpasso linked an issue Nov 8, 2023 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Nov 8, 2023

Test Results

       4 files  ±0         4 suites  ±0   3m 28s ⏱️ +4s
   434 tests +1     431 ✔️ +1    3 💤 ±0  0 ±0 
1 736 runs  +4  1 660 ✔️ +4  76 💤 ±0  0 ±0 

Results for commit a287c9f. ± Comparison against base commit b6dd367.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Code Coverage (Ubuntu)

File Coverage
All files 82%

Minimum allowed coverage is 70%

Generated by 🐒 cobertura-action against a287c9f

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Code Coverage (Windows)

File Coverage
All files 76%

Minimum allowed coverage is 70%

Generated by 🐒 cobertura-action against a287c9f

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.

  • if given provider is not found, please raise UnsupportedProvider()
  • if given product_type is not found, please raise UnsupportedProductType()
  • if product type is given, but no provider, only return preferred provider queryables instead of the union of all possibles

eodag/api/core.py Outdated Show resolved Hide resolved
eodag/api/core.py Outdated Show resolved Hide resolved
@dalpasso dalpasso marked this pull request as draft November 14, 2023 12:52
@dalpasso dalpasso marked this pull request as ready for review November 15, 2023 07:09
@dalpasso dalpasso marked this pull request as draft November 15, 2023 09:44
@dalpasso
Copy link
Collaborator Author

Changed the implementation:

  • added a default list of queryables to all the providers
  • when product_type is given, but no provider, then return the intersection of the queryables of all the providers supporting it

@dalpasso dalpasso marked this pull request as ready for review November 15, 2023 15:06
@alambare-csgroup alambare-csgroup marked this pull request as draft November 16, 2023 16:35
@alambare-csgroup alambare-csgroup marked this pull request as ready for review November 16, 2023 16:36
@alambare-csgroup alambare-csgroup force-pushed the 861-core-queryables branch 2 times, most recently from 1af5513 to 90dfc11 Compare December 1, 2023 18:19
@sbrunato sbrunato marked this pull request as draft December 5, 2023 15:09
@alambare-csgroup alambare-csgroup marked this pull request as ready for review December 6, 2023 15:45
@sbrunato sbrunato merged commit aa09d73 into develop Dec 6, 2023
12 checks passed
@sbrunato sbrunato deleted the 861-core-queryables branch December 6, 2023 16:37
alambare-csgroup added a commit that referenced this pull request Dec 12, 2023
Co-authored-by: LAMBARE Aubin <aubin.lambare@csgroup.eu>
Co-authored-by: Sylvain Brunato <sylvain.brunato@c-s.fr>
@sbrunato sbrunato added this to the 2.12.0 milestone Feb 12, 2024
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.

core queryables
3 participants