-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add deprecation warnings #1006
Add deprecation warnings #1006
Conversation
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.
The changes make sense to me, but I'm a little worried about the performance implications -- by looping through every asset on every serialization, we're adding some extra work to a very common operation. Does our current benchmark suite test an item with enough assets to pick up the change, and if so can we quantify that?
Yeah, me too. I forgot about our benchmark suite! I'll dig in and see what we can compare. |
I switched to the First Run:
Second Run:
No substantial effect, it seems. |
Some notes. @gadomski |
c375a24
to
c08d950
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.
Looks good. It'd be nice to use the version extension instead of accessing "deprecated"
directly -- if I recall correctly, we chatted offline about doing that first. Correct me if I'm wrong about that, @pjhartzell?
I think we should also add a section to the docs talking about deprecated objects and how to silence the warning.
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #1006 +/- ##
==========================================
+ Coverage 90.30% 90.34% +0.04%
==========================================
Files 47 47
Lines 6186 6213 +27
Branches 927 929 +2
==========================================
+ Hits 5586 5613 +27
Misses 422 422
Partials 178 178
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. |
@gadomski We now have a pared-down implementation that uses the Version extension to check only Items and Collections for deprecation. Contains a new Just want to raise a flag that adding
We're opening the door to the reality that different extension versions exist and may be present on a STAC object, but there is some decent refactor required to handle that reality. |
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.
TIL recwarn
, I like that a lot! Sorry for being a 🧇 on the has_extension
stuff -- if we don't keep the get_version
changes in this PR, let's make sure to put it into another branch/draft PR so we don't lose it, it's useful stuff.
Sounds good. I put a note on 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.
Thanks for making the change to try/except
, that reads much cleaner to me. I did a local benchmark run and no significant change. I also added another test section to see what happens when there's no extension url -- works fine.
ff33327
to
89b4f0a
Compare
Related Issue(s):
Description:
from_dict()
methods that checks for the version extension and, if it exists, issues aDeprecatedWarning
if the version extensiondeprecated
field is set toTrue
.ignore_deprecated
context manager to suppress theDeprecatedWarning
.This PR originally used logic outside the version extension to check for the
deprecated
field on assets. This was removed in favor of working within the version extension's current deprecation checking ability.PR Checklist:
pre-commit run --all-files
)scripts/test
)