Add filter parameters to FeaturesClient.list_items (closes #1221)#1222
Open
steps-re wants to merge 1 commit into
Open
Add filter parameters to FeaturesClient.list_items (closes #1221)#1222steps-re wants to merge 1 commit into
steps-re wants to merge 1 commit into
Conversation
The Features API list-items endpoint supports filtering and sorting, but list_items exposed none of it. Add the documented query parameters to both the async FeaturesClient.list_items and the sync FeaturesAPI.list_items: bbox, datetime, id (with ~ fuzzy matching), hashid, and sort. Only non-None filters are sent, so existing calls are unaffected; pagination is unchanged since the API carries the filters through the next links. Closes planetlabs#1221. Signed-off-by: Mike German <mike@stepsventures.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1221.
The Features API
GET /collections/{collectionId}/itemsendpoint supports filtering and sorting, butlist_itemsdidn't expose any of it. This adds the documented query parameters to both the asyncFeaturesClient.list_itemsand the syncFeaturesAPI.list_items:bbox— bounding box[xmin, ymin, xmax, ymax], serialized to the comma-separated form the API expectsdatetime— a single RFC 3339 datetime or an intervalid— id match, with a~prefix for substring (fuzzy) matchinghashidsort— e.g."id"/"-id"Only non-
Nonefilters are sent, so existing calls are unaffected. Pagination is unchanged: the filters go out on the first request and the API carries them through thenextlinks.Added
test_list_items_with_filters, which asserts every filter is forwarded as a query parameter for both the async and sync clients.flake8andyapfare clean on the touched files.