-
Notifications
You must be signed in to change notification settings - Fork 184
core: fix GridSpec deprecation warning #1745
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
Conversation
GridSpec is only used for type checking, so only import it for type checking to avoid triggering deprecation warnings. Refs opendatacube#1716
03d092c
to
b05b839
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1745 +/- ##
===========================================
- Coverage 85.45% 85.44% -0.01%
===========================================
Files 148 148
Lines 15513 15516 +3
===========================================
+ Hits 13256 13258 +2
- Misses 2257 2258 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The failing lint is fixed by #1744, no idea why readthedocs fails on this one. |
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.
This works... however a tidier fix would be importing from odc-geo
. That way there won't be anything to change when we do remove GridSpec from datacube-core.
from odc.geo.gridspec import GridSpec
The deprecation warning should give more explicit instructions, rather than vaguely pointing at |
That changes the interface in this file from expecting a I'm not against modernizing the API, but that kind of change (which could break type checking of datacube-core users) feels like something that should have been a part of 1.9.0, not something that appears in 1.9.3. |
After creation the two different GridSpec classes are compatible. Maybe even identical. I don't see it as changing an interface. It's updating the documentation of the interface, which I think is fine to do in a minor release. That said, this will work fine as well and can be updated when GridSpec is removed here. |
How hard would it be to make the datacube-core class into a thin wrapper over the odc-geo class? That would save nearly 200 lines of code in this package, and reduce the risk that the classes are different in any major ways. Why is the deprecation message for |
Reason for this pull request
GridSpec is only used for type
checking, so only import it for
type checking to avoid triggering
deprecation warnings.
Refs #1716
Proposed changes
Closes #xxxx
Tests added / passed
Fully documented, including
docs/about/whats_new.rst
for all changes📚 Documentation preview 📚: https://datacube-core--1745.org.readthedocs.build/en/1745/