Skip to content

Commit e579f46

Browse files
committed
fix
1 parent ff3bfd7 commit e579f46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

xrlint/_linter/validate.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ def _open_dataset(
9292
try:
9393
t0 = time.time()
9494
result = xr.open_datatree(ds_source, engine=engine, **(opener_options or {}))
95-
except (OSError, ValueError, TypeError):
95+
# When opening no-group Zarr datasets we get with xarray 2025.1.2:
96+
#
97+
# File "<...>/site-packages/xarray/backends/zarr.py", line 741, in __init__
98+
# self._read_only = self.zarr_group.read_only
99+
# ^^^^^^^^^^^^^^^^^^^^^^^^^
100+
# AttributeError: 'NoneType' object has no attribute 'read_only'
101+
except (OSError, ValueError, TypeError, AttributeError):
96102
t0 = time.time()
97103
result = xr.open_dataset(ds_source, engine=engine, **(opener_options or {}))
98104
return result, time.time() - t0

0 commit comments

Comments
 (0)