Skip to content

Commit a6e4521

Browse files
authored
Do not pass an empty filters list to ArrayV2Metadata (#720)
1 parent caa24a5 commit a6e4521

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

virtualizarr/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def convert_v3_to_v2_metadata(
133133
The metadata object in v2 format.
134134
"""
135135

136-
# TODO: Find a more robust way to exclude any bytes codecs
137-
# TODO: Test round-tripping big endian since that is stored in the bytes codec in V3; it should be included in data type instead for V2
136+
# TODO: Check that all ArrayBytesCodecs should in fact be excluded for V2 metadata storage.
137+
# TODO: Test round-tripping big endian since that is stored in the bytes codec in V3; it should be included in data type instead for V2.
138138
v2_codecs = [
139139
zarr_codec_config_to_v2(get_codec_config(codec))
140140
for codec in v3_metadata.codecs
@@ -145,7 +145,9 @@ def convert_v3_to_v2_metadata(
145145
dtype=v3_metadata.data_type,
146146
chunks=v3_metadata.chunks,
147147
fill_value=fill_value or v3_metadata.fill_value,
148-
filters=v2_codecs,
148+
filters=v2_codecs
149+
if v2_codecs
150+
else None, # Do not pass an empty list to ArrayV2Metadata
149151
compressor=None,
150152
order="C",
151153
attributes=v3_metadata.attributes,

0 commit comments

Comments
 (0)