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

need support product grouping in core #1359

Open
pindge opened this issue Nov 23, 2022 · 5 comments
Open

need support product grouping in core #1359

pindge opened this issue Nov 23, 2022 · 5 comments

Comments

@pindge
Copy link
Contributor

pindge commented Nov 23, 2022

ASTERS are not part of DEA products, but due to alphabetical ordering they are always the first products showing up on query dc.list_products()

image

core should add a feature to support pre-identified grouping, ie.

dc.list_products(group='c3')

@robbibt
Copy link
Contributor

robbibt commented Nov 28, 2022

Yep, being able to sort our datasets by the "Baseline satellite data", "Inland water" etc groupings would be really nice!

@pindge
Copy link
Contributor Author

pindge commented Nov 29, 2022

one potential solution is to add product_category to product metadata definition, and to query against it

[8:38 AM] Paul Haesler
If product_category was listed in the metadata_type as a search field, you could use dc.index.products.search_robust(product_category="foo") - but you'd still need to trawl through the results manually. search_robust is the only method provided for searching products, and it's really intended for internal use by the dataset search methods rather than direct user use.

Even then, it's highly inefficient - there's an implicit assumption that the product table is small enough that it's OK to do a full table scan every query, so honestly, you may as well just do that manually.
​[8:40 AM] Paul Haesler
The search_robust code would look something like:

[ prod for prod, unmatchable in dc.index.search_robust(product_category="foo") if not unmatchable]

@SpacemanPaul
Copy link
Contributor

As noted in Teams, a products version of search_by_metadata would be doable.

@SpacemanPaul
Copy link
Contributor

SpacemanPaul commented Dec 1, 2022

Oh correction to above:

[ prod for prod, unmatchable in dc.index.products.search_robust(product_category="foo") if not unmatchable]

is equivalent to:

dc.index.products.search(product_category="foo")

But again, this requires product_category to be configured search field.

@stale
Copy link

stale bot commented Apr 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 2, 2023
@omad omad added the usability label Jun 1, 2023
@SpacemanPaul SpacemanPaul added the v2 label Jun 1, 2023
@omad omad modified the milestones: Future milestones, ODCv1.9 Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants