-
Notifications
You must be signed in to change notification settings - Fork 18
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
Extending temporal search #182
base: main
Are you sure you want to change the base?
Conversation
@rhysrevans3 This pr looks really good. We have just been in the middle of adding opensearch support. Do you have any experience with opensearch? |
@jonhealy1 I've added some more tests but realised the current version of stac-pydantic the api is using doesn't allow a |
I don't have any experience with Opensearch but am happy merge main's changes into this branch and try to add this functionality to the opensearch parts. |
@rhysrevans3 Any new thoughts? Hopefully we can merge this soon. |
…fastapi-elasticsearch into extend_datetime_search
…ch into extend_datetime_search
@jonhealy1 update on this pull request:
|
Hi @rhysrevans3, the pydantic v2 is merged now into main via stac-pydantic if you want to have another look at this. Cheers. |
@jonhealy1 it looks like that stac-pydantic still won't allow a null datetime I thought the validator would allow this but I think the typing stops it. https://github.com/stac-utils/stac-pydantic/blob/main/stac_pydantic/item.py#L31-L58 Good news is there appears to be 3 pull requests that will fix this: Sorry for the delay in this. |
Hi @rhysrevans3 - no problems whatsoever - thanks for staying on top of this! |
@jonhealy1 looks like this might be finally ready to merge. :) |
…rch into extend_datetime_search
…fastapi-elasticsearch into extend_datetime_search
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.
Hey, this looks great. I just have a couple questions about how the queries are formatted
Q( | ||
"range", | ||
properties__start_datetime={ | ||
"lte": datetime_search["eq"], |
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.
Should this be "gte": datetime_search["eq"],
to find the dates larger than the start_datetime
?
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.
Yes and no, It's a bit counter intuitive. The check it's actually the opposite, so it's searching for any items with a start_datetime
that's before or equal to (lte
) the given datetime_search["eq"]
.
Q( | ||
"range", | ||
properties__end_datetime={ | ||
"gte": datetime_search["eq"], |
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.
Should this be "lte": datetime_search["eq"],
to find the dates smaller than the end_datetime
?
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.
Similarly this is searching for any items with a end_datetime
that's after or equal to (gte
) the given date time datetime_search["eq"]
.
), | ||
], | ||
), | ||
Q( |
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.
Could you explain this last query?
Do both start_
and end_datetimes
need to be within the date range?
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.
This part concerns date range searches. It returns any items who's datetime
property is with the queried date range or who's date range (start_datetime
and end_datetime
) has any overlap with the queried date range.
- The first part searches for items with a
datetime
property within the queried date range. - The second part searches for an overlap of date ranges and is split in 3:
i. Thestart_datetime
of an item is within the queried date range.
ii. Theend_datetime
of an item is within the queried date range.
iii. The the queried date range is with the item's date range. The queriedstart_datetime
is after the item'sstart_datetime
and The queriedend_datetime
is after the item'send_datetime
.
I think this captures all cases.
Apologies if any of this is unclear.
Related Issue(s):
Description:
Extending temporal search include start_datetime and end_datetime properties
PR Checklist:
pre-commit run --all-files
)make test
)