-
Notifications
You must be signed in to change notification settings - Fork 22
Zero-config dynamically-generated queryables, Performance fixes #351
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
Conversation
…cause it looks odd
Hi @Zaczero. Looks really good, just a few linting errors. |
It would be nice to have @rhysrevans3 look at this as he is doing work on the queryables. |
@jonhealy1 This looks good to me and is probably a neater solution for @Zaczero am I right in saying this doesn't change the filter extension query? So doesn't effect the queryables mapping that is used in to_es |
@rhysrevans3 I sent you an invite to be a maintainer of this project so you can do an official pr review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good!
@jonhealy1 I think my queryables pull request could still be useful. It takes a different approach, extracting the fields from the extensions where possible and does something similar to this pull request for the other properties. I'd be happy to attempt to merge the two methods in my pull request once this one is accepted if we want both?
@@ -6,7 +6,7 @@ | |||
desc = f.read() | |||
|
|||
install_requires = [ | |||
"fastapi-slim", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my education what does fastapi
have that fastapi-slim
doesn't have for us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess fastapi-slim isn't really going to still be a thing in the future. fastapi/fastapi#11525 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fastapi-slim is, I think, a barebones version of fastapi but now the default fastapi is barebones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns: | ||
str: The index name derived from the collection id. | ||
""" | ||
cleaned = collection_id.translate(_ES_INDEX_NAME_UNSUPPORTED_CHARS_TABLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seen this before very cool!
"cloud_cover": { | ||
"description": "Cloud Cover", | ||
"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fields/properties/eo:cloud_cover", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this isn't your change but is this right? But shouldn't the key be eo:cloud_cover
? My understanding of the queryables the extension isn't removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about this personally. Should we create an issue to look into this?
This looks amazing. I'd like to follow this same approach to generate aggregations as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Zaczero. Looks great!
Related Issue(s):
Description:
This PR consists of self-contained commits (except the first commit that provides database_logic deduplication), making it easy to change or remove individual patches. It addresses several small issues, improves the performance of certain methods, and adds support for dynamically-generated queryables. This enhancement doesn't require any new configuration as queryables are generated on the fly based on the os/es mappings. The implementation is designed for extensibility, with built-in logic for augmenting fields metadata with additional information. Currently, it only includes the _DEFAULT_QUERYABLES configuration, which was simply copied from the pre-PR code.
Example queryables response:
PS. I think the auto-generated "title" should be removed completely, but I included it because I found it to be common practice in some STAC projects. I'm not sure how you feel about it.
PR Checklist:
pre-commit run --all-files
)make test
)