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

feat: use ogciapi-features for get_item #166

Merged
merged 2 commits into from
May 31, 2022
Merged

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented May 20, 2022

Related Issue(s):

Description:
If a collection client conforms to ogciapi-features, use it to fetch the item by id. This is much faster than the default behavior of finding via iteration.

Includes:

  • Probably overly-pedantic assertions to make the type checker happy
  • A new entry in the conformance enum
  • A from_response classmethod on APIError to carry through the status_code
  • Fixing a double throw-catch in StacApiIO.request
  • Unit test for positive and negative cases

This is a feature-adding (non-breaking) change, so could go into a v0.3.X release.

PR Checklist:

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

@gadomski gadomski requested a review from matthewhanson May 20, 2022 17:50
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #166 (2fe61a4) into main (dbdc3a4) will increase coverage by 0.26%.
The diff coverage is 76.74%.

@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
+ Coverage   81.00%   81.27%   +0.26%     
==========================================
  Files           9        9              
  Lines         558      598      +40     
==========================================
+ Hits          452      486      +34     
- Misses        106      112       +6     
Impacted Files Coverage Δ
pystac_client/stac_api_io.py 84.54% <60.00%> (+2.30%) ⬆️
pystac_client/collection_client.py 76.19% <72.41%> (-9.53%) ⬇️
pystac_client/conformance.py 100.00% <100.00%> (ø)
pystac_client/exceptions.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbdc3a4...2fe61a4. Read the comment docs.

gadomski added 2 commits May 31, 2022 10:51
If a collection client conforms to ogciapi-features, use it to fetch the item by id. This is much faster than the default
behavior of finding via iteration.

Includes:
- Probably overly-pedantic assertions to make the type checker happy
- A new entry in the conformance enum
- A `from_response` classmethod on APIError to carry through the status_code
- Fixing a double throw-catch in StacApiIO.request
- Unit test for positive and negative cases
@gadomski gadomski force-pushed the issues/136-use-items-endpoint branch from 2fe61a4 to ce0236a Compare May 31, 2022 16:53
@gadomski gadomski merged commit fbcadb8 into main May 31, 2022
@gadomski gadomski deleted the issues/136-use-items-endpoint branch May 31, 2022 20:08
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.

Use OAFeat items endpoint for get_item
3 participants