Uh oh!
There was an error while loading. Please reload this page.
Use implicit fill values for zarr v2 - #2274
Conversation
jhamman
left a comment
There was a problem hiding this comment.
A few comments. Seems reasonable though.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rabernat
left a comment
There was a problem hiding this comment.
This looks good. My one suggestion would be to consider a special case for object / string dtypes.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| out[out_selection] = chunk_spec.fill_value | ||
| fill_value = chunk_spec.fill_value | ||
| if fill_value is None: |
There was a problem hiding this comment.
Something we may consider in the future is to parameterize the CodecPipeline class with the zarr_format of the calling Array. This would allow us feel more confident that workarounds like this one only apply to v2 data.
Closes#2271
I'm not sure if this is a good idea, but this, consolidated metadata, and #2270 lets xarray round trip a dataset. The basic idea is to let
ArrayV2Metadatarepresent the v2 metadata a bit more faithfully. Currently, we "eagerly" interpret the lack offill_valuein a V2 document as the default fill value for some dtype (e.g.0for int64). This PR changes that, to allowArrayV2Metadata.fill_valueto be None if it's unspecified in the metadata. But we do need some fill value when reading data. So that's where we finally substitute in the default.This doesn't really affect Zarr directly, but it is useful for downstream libraries that want to inspect the array metadata before reading and make some decision based on whether or not
fill_valueis specified.TODO: