Skip to content
New issue

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

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

Already on GitHub? # to your account

PgSTAC: API hydration of search result items #397

Merged
merged 27 commits into from
May 14, 2022

Conversation

mmcfarland
Copy link
Contributor

@mmcfarland mmcfarland commented Apr 27, 2022

Related Issue(s):

Description:

  • Adds support for pgstac backend to hydrate search results with base_items when the nohydrate option is set.
  • Aligns pgstac backend Fields Extension with pgstac psql implementation

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the CHANGELOG.

mmcfarland and others added 7 commits April 28, 2022 15:03
Initial changes to get most tests passing.
This was done in a pairing session with @mmcfarland
Use of the fields extension can result in the return of invalid stac
items if excludes is used on required attributes. When injecting item
links, don't attempt to build links for which needed attributes aren't
available. When API Hydrate is enabled, the required attributes are
preserved prior to filtering and are used in the link generation.
In practice, an asset on a base_item and an item may have mergable
dicts (ie, raster bands).
This will be used by implementors who need app state which is stored on
request.
mmcfarland added 3 commits May 4, 2022 19:01
The hydrate function was improved and moved to pypgstac so it could be
used in other projects outside of stac-fastapi. It was developed with a
corresponding dehydrate function to ensure parity between the two.

The version of pypgstac is unpublished and pinned to a draft commit at
the point and will be upgraded subsequently.
Correctly supports deeply nested property keys in both include and
exclude, as well as improves variable naming, comments, and test cases.
@mmcfarland mmcfarland marked this pull request as ready for review May 12, 2022 21:22
@mmcfarland mmcfarland requested a review from lossyrob May 12, 2022 21:23
@mmcfarland
Copy link
Contributor Author

@lossyrob @bitner Got all the tests passing, this is ready for a final review.

@lossyrob
Copy link
Member

@mmcfarland one outstanding question about dependencies, but otherwise LGTM! Will hit approve after that convo wraps up.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants