Skip to content

Commit

Permalink
Dont write _ARRAY_DIMENSIONS to icechunk (#286)
Browse files Browse the repository at this point in the history
* dont write _ARRAY_DIMENSIONS

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* release note

* change test

* add xarray 2024.10.0 dependency to icechunk CI

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
TomNicholas and pre-commit-ci[bot] authored Nov 7, 2024
1 parent efbc493 commit 2d7b4ee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Bug fixes
- Fixed regression in `fill_value` handling for datetime dtypes making virtual
Zarr stores unreadable (:pull:`206`)
By `Timothy Hodson <https://github.com/thodson-usgs>`_
- Fixed bug with writing of `dimension_names` into zarr metadata.
(:pull:`286`) By `Tom Nicholas <https://github.com/TomNicholas>`_.

Documentation
~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion virtualizarr/tests/test_writers/test_icechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_write_new_virtual_variable(
# assert dict(arr.attrs) == {"units": "km"}

# check dimensions
assert arr.attrs["_ARRAY_DIMENSIONS"] == ["x", "y"]
assert arr.metadata.dimension_names == ("x", "y")


def test_set_single_virtual_ref_without_encoding(
Expand Down
1 change: 0 additions & 1 deletion virtualizarr/writers/icechunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def write_virtual_variable_to_icechunk(
# TODO it would be nice if we could assign directly to the .attrs property
for k, v in var.attrs.items():
arr.attrs[k] = encode_zarr_attr_value(v)
arr.attrs["_ARRAY_DIMENSIONS"] = encode_zarr_attr_value(var.dims)

_encoding_keys = {"_FillValue", "missing_value", "scale_factor", "add_offset"}
for k, v in var.encoding.items():
Expand Down

0 comments on commit 2d7b4ee

Please sign in to comment.