-
Notifications
You must be signed in to change notification settings - Fork 48
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
Terminate on empty page #338
Conversation
07e815c
to
d52f2ce
Compare
Codecov ReportBase: 85.18% // Head: 85.60% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
==========================================
+ Coverage 85.18% 85.60% +0.41%
==========================================
Files 11 11
Lines 790 792 +2
==========================================
+ Hits 673 678 +5
+ Misses 117 114 -3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
bdce856
to
448b67a
Compare
e4c4948
to
2d8d459
Compare
645b381
to
8b90adb
Compare
8b90adb
to
3ccafae
Compare
3ccafae
to
fc1df8c
Compare
fc1df8c
to
b5bb1ce
Compare
b5bb1ce
to
9e4bfea
Compare
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.
Is it possible that the initial page can have no features
and we would want to return None
? Or is this moot/handled in other ways?
pystac-client/pystac_client/stac_api_io.py
Lines 229 to 230 in 9e4bfea
page = self.read_json(url, method=method, parameters=parameters) | |
yield page |
Yeah, it's a good point, we should return None (to stop iteration) if features is empty on first grab. I'll implement. |
@pjhartzell good catch. I missed the documentation that those pages were used for collection paging as well as item paging. By adding the early short-circuit, I broke of collection fetching tests. I've updated the test suite and the code to handle both item and collection paging. |
dd084a9
to
acb1866
Compare
Well, I wasn't thinking about both collection and item paging either. But glad my suggestion broke stuff enough to make that bubble up. 🙂 |
Related Issue(s):
Description:
Terminate pagination on an empty page.
PR Checklist: