|
31 | 31 | create_array, |
32 | 32 | ) |
33 | 33 | from zarr.core.attributes import Attributes |
34 | | -from zarr.core.buffer import Buffer, default_buffer_prototype |
| 34 | +from zarr.core.buffer import default_buffer_prototype |
35 | 35 | from zarr.core.common import ( |
36 | 36 | JSON, |
37 | 37 | ZARR_JSON, |
@@ -573,8 +573,8 @@ def _from_bytes_v2( |
573 | 573 | v2_consolidated_metadata = json.loads(consolidated_metadata_bytes.to_bytes()) |
574 | 574 | v2_consolidated_metadata = v2_consolidated_metadata["metadata"] |
575 | 575 | # We already read zattrs and zgroup. Should we ignore these? |
576 | | - v2_consolidated_metadata.pop(".zattrs") |
577 | | - v2_consolidated_metadata.pop(".zgroup") |
| 576 | + v2_consolidated_metadata.pop(".zattrs", None) |
| 577 | + v2_consolidated_metadata.pop(".zgroup", None) |
578 | 578 |
|
579 | 579 | consolidated_metadata: defaultdict[str, dict[str, Any]] = defaultdict(dict) |
580 | 580 |
|
@@ -1011,7 +1011,7 @@ async def create_array( |
1011 | 1011 | shards: ShardsLike | None = None, |
1012 | 1012 | filters: FiltersLike = "auto", |
1013 | 1013 | compressors: CompressorsLike = "auto", |
1014 | | - compressor: CompressorLike = None, |
| 1014 | + compressor: CompressorLike = "auto", |
1015 | 1015 | serializer: SerializerLike = "auto", |
1016 | 1016 | fill_value: Any | None = 0, |
1017 | 1017 | order: MemoryOrder | None = None, |
@@ -1114,8 +1114,9 @@ async def create_array( |
1114 | 1114 | AsyncArray |
1115 | 1115 |
|
1116 | 1116 | """ |
1117 | | - |
1118 | | - compressors = _parse_deprecated_compressor(compressor, compressors) |
| 1117 | + compressors = _parse_deprecated_compressor( |
| 1118 | + compressor, compressors, zarr_format=self.metadata.zarr_format |
| 1119 | + ) |
1119 | 1120 | return await create_array( |
1120 | 1121 | store=self.store_path, |
1121 | 1122 | name=name, |
@@ -2244,7 +2245,7 @@ def create_array( |
2244 | 2245 | shards: ShardsLike | None = None, |
2245 | 2246 | filters: FiltersLike = "auto", |
2246 | 2247 | compressors: CompressorsLike = "auto", |
2247 | | - compressor: CompressorLike = None, |
| 2248 | + compressor: CompressorLike = "auto", |
2248 | 2249 | serializer: SerializerLike = "auto", |
2249 | 2250 | fill_value: Any | None = 0, |
2250 | 2251 | order: MemoryOrder | None = "C", |
@@ -2346,7 +2347,9 @@ def create_array( |
2346 | 2347 | ------- |
2347 | 2348 | AsyncArray |
2348 | 2349 | """ |
2349 | | - compressors = _parse_deprecated_compressor(compressor, compressors) |
| 2350 | + compressors = _parse_deprecated_compressor( |
| 2351 | + compressor, compressors, zarr_format=self.metadata.zarr_format |
| 2352 | + ) |
2350 | 2353 | return Array( |
2351 | 2354 | self._sync( |
2352 | 2355 | self._async_group.create_array( |
|
0 commit comments