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

Use has_extension rather than deprecated validate_has_extension #134

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

jsignell
Copy link
Contributor

With pystac 1.9 there validate_has_extension is deprecated, so there was a warning cropping up. This seemed like a simpler solution anyways.

@Kirill888
Copy link
Member

Thanks for the PR, do you know when has_extension was added, do we need to update lower bound on pystac library for this change?

ext_name.startswith("https://stac-extensions.github.io/raster/")
for ext_name in item.stac_extensions
)
return RasterExtension.has_extension(item)
Copy link
Member

Choose a reason for hiding this comment

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

Tests are failing because of this change, I realize that newer version of pystac are more lenient as far as versions of extensions are concerned, but we might need to support older versions for a bit, so can we have that "dodgy check" back?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On second thought, the "dodgy check" is kind of separate. I can add it back in.

@jsignell
Copy link
Contributor Author

Thanks for the PR, do you know when has_extension was added, do we need to update lower bound on pystac library for this change?

Yeah it seems like has_extension has been in pystac since 1.0.0, but I take your point about pystac<1.9.0 being less flexible about how it checks for extensions.

Would it make sense to just bump up the floor for min pystac supported by this library?

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (138846f) 87.44% compared to head (8de58b0) 87.41%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #134      +/-   ##
===========================================
- Coverage    87.44%   87.41%   -0.03%     
===========================================
  Files           19       19              
  Lines         1864     1860       -4     
===========================================
- Hits          1630     1626       -4     
  Misses         234      234              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

odc/stac/_mdtools.py Outdated Show resolved Hide resolved
odc/stac/_mdtools.py Outdated Show resolved Hide resolved
odc/stac/_mdtools.py Outdated Show resolved Hide resolved
Copy link
Member

@Kirill888 Kirill888 left a comment

Choose a reason for hiding this comment

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

thanks

@Kirill888 Kirill888 merged commit 0bf4655 into opendatacube:develop Dec 18, 2023
13 checks passed
@jsignell jsignell deleted the has_extension branch December 19, 2023 18:53
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.

2 participants