Skip to content
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

Remove default limit #584

Merged
merged 2 commits into from
Sep 5, 2023
Merged

Remove default limit #584

merged 2 commits into from
Sep 5, 2023

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented Sep 1, 2023

Related Issue(s):

Description:

We should trust the server to know how many things it wants to respond with. Tagging in a couple of folks for reviews since this is changing default behavior. I don't think this is worth marking as a breaking change (thereby forcing a v0.8), but happy to be convinced otherwise.

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

@gadomski gadomski self-assigned this Sep 1, 2023
We should trust the server to know how many things it will response with.
Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I like this. That limit always seemed weird to me

@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Patch coverage is 60.00% of modified lines.

Files Changed Coverage
pystac_client/client.py ø
pystac_client/item_search.py 60.00%

📢 Thoughts on this report? Let us know!.

@TomAugspurger
Copy link
Collaborator

@gadomski can you share a bit more (here or in the docs) about how this changes the behavior (maybe depending on how the sever is behaving w.r.t. limit)?

We should trust the server to know how many things it wants to respond with.

Is that part of the response body to /search, or just some configuration value on the server?

@gadomski
Copy link
Member Author

gadomski commented Sep 5, 2023

@gadomski can you share a bit more (here or in the docs) about how this changes the behavior (maybe depending on how the sever is behaving w.r.t. limit)?

Sure ... this PR changes behavior so that pystac-client, by default, does not send a limit to the search endpoint. The rationale is that the server (presumably) has been tuned to use a reasonable page size by default, and the client shouldn't presume to know better.

Is that part of the response body to /search, or just some configuration value on the server?

Configuration in the server, e.g. for stac-fastapi it's 10: https://github.com/stac-utils/stac-fastapi/blob/main/stac_fastapi/types/stac_fastapi/types/search.py#L125

@TomAugspurger
Copy link
Collaborator

Ok, thanks. Looks like on the Planetary Computer, we have it set to 250:

curl --silent "https://planetarycomputer.microsoft.com/api/stac/v1/search" | jq '.features | length'
250

Following the guidance of the server (by default) makes sense to me.

@gadomski gadomski merged commit 61f8b07 into main Sep 5, 2023
17 checks passed
@gadomski gadomski deleted the remove-default-limit branch September 5, 2023 15:01
@gadomski gadomski mentioned this pull request Sep 5, 2023
3 tasks
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.

4 participants