-
Notifications
You must be signed in to change notification settings - Fork 186
Ensure truly safe loading of netcdf drivers. #2305
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
base: develop
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2305 +/- ##
===========================================
- Coverage 86.13% 86.12% -0.02%
===========================================
Files 155 154 -1
Lines 16955 16949 -6
===========================================
- Hits 14605 14598 -7
- Misses 2350 2351 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| _LOG.warning("Error was: %s", repr(e)) | ||
| return None | ||
|
|
||
| try: |
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'm not sure how things are wired up, but isn't there a missing if driver_init is None: before this try?
It's possible I'm in the wrong place, but there should be a check for the new None value returned from reader_driver_init and writer_driver_init somewhere.
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.
Please add the missing None check where it should be before merging this.
Besides that I think this looks great, can't wait to not have those warnings in the logs!
Edit: I've spent a fair amount of time on debugging ODC-related things now and I find it difficult to read and navigate both git commit logs and git blame when the same logical change is spread out over multiple commits. The scattered commits also frequently have a commit message that mostly makes sense when read in sequence of the commit stack of the PR, not when looking at an individual commit. For this particular PR, I'm guessing it should consist of one or at most two commits.
Reason for this pull request
Distracting messages when reading from non-netcdf files when netCDF4 is not installed as per #2282
Proposed changes
Ensure netCDF driver can be loaded enough to cleanly report that it cannot be loaded enough to actually use
Prevent
datacube.driver.netcdf.__init__from importing stuff that might break.Closes #xxxx
Tests added / passed
Pull Request Title will make sense in ODC Release Notes
📚 Documentation preview 📚: https://opendatacube--2305.org.readthedocs.build/en/2305/