Skip to content

Commit 19675e4

Browse files
committed
add test
1 parent 9e8b50a commit 19675e4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_metadata/test_v3.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,20 @@ def test_dtypes(dtype_str: str) -> None:
411411
else:
412412
# return type for vlen types may vary depending on numpy version
413413
assert dt.byte_count is None
414+
415+
416+
def test_metadata_comparison_with_nan_fill_value():
417+
# regression test for https://github.com/zarr-developers/zarr-python/issues/2929
418+
metadata_dict = {
419+
"zarr_format": 3,
420+
"node_type": "array",
421+
"shape": (1,),
422+
"chunk_grid": {"name": "regular", "configuration": {"chunk_shape": (1,)}},
423+
"data_type": np.dtype("float32"),
424+
"chunk_key_encoding": {"name": "default", "separator": "."},
425+
"codecs": ({'name': 'bytes', 'configuration': {'endian': 'little'}},),
426+
"fill_value": np.float32("nan"),
427+
}
428+
metadata1 = ArrayV3Metadata.from_dict(metadata_dict)
429+
metadata2 = ArrayV3Metadata.from_dict(metadata_dict)
430+
assert metadata1 == metadata2

0 commit comments

Comments
 (0)