You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In core/timeslice.py, FileNotFoundError is caught and used to trigger a fallback behaviour for a missing file. This code broke with the xarray 0.18.0 release. I reported this as a bug at pydata/xarray#5329 and implemented a temporary workaround (catching ValueError as well as FileNotFoundError), but ongoing discussions there indicate that we probably won't be able to rely on FileNotFoundError always being thrown. We should:
Explicitly specify the zarr store for open_dataset here -- this doesn't directly fix the problem (since the zarr engine throws a GroupNotFoundError rather than the FileNotFoundError previously thrown by the automatically selected netcdf4 engine), but makes the behaviour more robust and explicit and any errors easier to diagnose.
Catch the GroupNotFoundError to trigger the fallback behaviour. Don't catch ValueError or FileNotFoundError any more, since they're no longer expected to be thrown when the zarr engine is explicitly specified.
Do an explicit check for file presence before the call, which should mean that the GroupNotFoundError is rarely thrown in the first place.
This should also be done anywhere else where we're relying on FileNotFoundError in the same way elsewhere in the xcube codebase, but from a quick grep it appears that there aren't any other usages.
The text was updated successfully, but these errors were encountered:
In
core/timeslice.py
,FileNotFoundError
is caught and used to trigger a fallback behaviour for a missing file. This code broke with the xarray 0.18.0 release. I reported this as a bug at pydata/xarray#5329 and implemented a temporary workaround (catchingValueError
as well asFileNotFoundError
), but ongoing discussions there indicate that we probably won't be able to rely onFileNotFoundError
always being thrown. We should:zarr
store foropen_dataset
here -- this doesn't directly fix the problem (since the zarr engine throws aGroupNotFoundError
rather than theFileNotFoundError
previously thrown by the automatically selected netcdf4 engine), but makes the behaviour more robust and explicit and any errors easier to diagnose.GroupNotFoundError
to trigger the fallback behaviour. Don't catchValueError
orFileNotFoundError
any more, since they're no longer expected to be thrown when the zarr engine is explicitly specified.GroupNotFoundError
is rarely thrown in the first place.This should also be done anywhere else where we're relying on
FileNotFoundError
in the same way elsewhere in the xcube codebase, but from a quick grep it appears that there aren't any other usages.The text was updated successfully, but these errors were encountered: