Skip to content

Add filter parameters to FeaturesClient.list_items (closes #1221) - #1222

Open
steps-re wants to merge 2 commits into
planetlabs:mainfrom
steps-re:features-list-items-filters
Open

steps-re wants to merge 2 commits into
planetlabs:mainfrom
steps-re:features-list-items-filters

Conversation

@steps-re

@steps-re steps-re commented Jul 7, 2026 •

Copy link
Copy Markdown

Closes #1221.

The Features API GET /collections/{collectionId}/items endpoint supports filtering and sorting, but list_items didn't expose any of it. This adds the documented query parameters to both the async FeaturesClient.list_items and the sync FeaturesAPI.list_items:

  • bbox, bounding box [xmin, ymin, xmax, ymax], serialized to the comma-separated form the API expects
  • id, id match, with a ~ prefix for substring (fuzzy) matching
  • hashid
  • sort, "id" or "-id"
  • view, sent as _view: items, wkb64, basic or refs

Only non-None filters are sent, so existing calls are unaffected. Pagination is unchanged: the filters go out on the first request and the API carries them through the next links. Both clients carry the same parameter docs.

test_list_items_with_filters checks the full set of sent query params with one shared assertion for the async and sync clients. nox -s lint analyze is clean and the full test suite passes.

@ischneider ischneider self-assigned this Nov 23, 2026
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>
@ischneider
ischneider force-pushed the features-list-items-filters branch from fa06e99 to f130419 Compare November 23, 2026 19:54
@ischneider

Copy link
Copy Markdown
Member

Thanks for your contribution!

A few comments:

datetime was removed from the Features API spec for the items endpoint.
Add view, sent as _view (items, wkb64, basic, refs). Give the sync
list_items the same parameter docs as the async client, and check the
sent params with one shared assertion for both clients.
@steps-re

Copy link
Copy Markdown
Author

thanks for the review. pushed c93e8e1:

  • dropped datetime
  • added view, sent as _view (items / wkb64 / basic / refs, typed as a Literal)
  • sync list_items now has the same parameter docs as the async one
  • test uses a single check_params() for both clients that compares the whole sent query dict to the expected filters, so a dropped or extra param fails it

lint, mypy and the full suite pass locally.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FeaturesClient list_items does not support filtering

2 participants