-
Notifications
You must be signed in to change notification settings - Fork 50
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
Implement new ItemSearch result consumers #284
Implement new ItemSearch result consumers #284
Conversation
Followup to stac-utils#277 and closes stac-utils#279 the `cli.search` and `get_all_items()` / `item_collection()` were using this deprecated method. Users using non-deprecated APIs shouldn't be getting deprecation warnings. Clearly it's useful, so let's either un-deprecate it or move the implementaiton to a private method and call that directly. I've chosen to un-deprecate it. I've also configured pytest to fail on warnings, to catch this type of issue in CI.
I've repurposed this PR to implement #285, since it would have created a merge conflict anyway. I've slipped in a couple additional changes which I'll point out inline. |
Codecov Report
@@ Coverage Diff @@
## main #284 +/- ##
==========================================
+ Coverage 84.36% 84.90% +0.53%
==========================================
Files 11 11
Lines 774 775 +1
==========================================
+ Hits 653 658 +5
+ Misses 121 117 -4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
A couple of inline comments, and two top-level
- I really like the way things chain down to
pages_as_dict
. This feels very natural and will allow good control in the future over fetching strategies, etc. - Should we commit to a removal schedule for the deprecated methods (e.g. v0.6.0)?
I'm going to request @matthewhanson's review as well since this is a relatively significant architectural shift.
I like these changes, the new function names are intuitive and descriptive. |
Sure. This came up before, but I'd like at least one release where the warnings are elevated to In [1]: import pystac_client
In [2]: catalog = pystac_client.Client.open("https://planetarycomputer.microsoft.com/api/stac/v1")
In [3]: search = catalog.search(collections=["sentinel-2-l2a"], datetime="2022-01-01")
In [4]: search.get_item_collections()
Out[4]: <generator object ItemSearch.pages at 0x7f72b3542580> |
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.
I'd like at least one release where the warnings are elevated to FutureWarning since the warnings aren't visible to users working interactively at the moment
Makes sense to me. Since our next release will be v0.5.0, should we upgrade to FutureWarning
in v0.6.0 and then remove in v0.7.0, maybe as part of a "v1 roadmap" to stabilize the public API (xref radiantearth/stac-spec#1184)?
@gadomski updated to fix the merge conflicts from the signing PR. In general, the |
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.
Sorry for not catching this earlier, but I think some of the docstrings needed some typing fixups.
Co-authored-by: Pete Gadomski <[email protected]>
Good catch. Applied those changes and CI is all green. |
I've opened #295 to track the |
Closes #285
(original description)
Followup to #277 and
closes #279
the
cli.search
andget_all_items()
/item_collection()
were usingthis deprecated method. Users using non-deprecated APIs shouldn't be
getting deprecation warnings.
Clearly it's useful, so let's either un-deprecate it or move the
implementaiton to a private method and call that directly. I've chosen
to un-deprecate it.
I've also configured pytest to fail on warnings, to catch this type of
issue in CI.