YAXArrays.jl icon indicating copy to clipboard operation
YAXArrays.jl copied to clipboard

Type mismatch for cubes with missing values

Open felixcremer opened this issue 3 years ago • 0 comments

I found the source of the type mismatch of opening the esdc or opening it directly from a path.

In the esdc function we use zopen to open the path to the esdc which returns a ZGroup which is then converted into a ZarrDataset by the open_dataset function.

When we use the string directly we use the ZarrDataset method for string inputs in YAXArrayBase which is defined here: https://github.com/JuliaDataCubes/YAXArrayBase.jl/blob/1f91f2ef52fe4943da4af01dcc20df4694116c1c/src/datasets/zarr.jl#L7 with the following definition

ZarrDataset(g::String;mode="r") = ZarrDataset(zopen(g,mode,fill_as_missing=false))

Therefore, we call here zopen with fill_as_missing as false and therefore do not get the Union{T, Missing} as type information. For now you can just open the data with the Cube(open_dataset(zopen(path))). This is related to #181.

@meggart @gdkrmr

felixcremer avatar Oct 11 '22 09:10 felixcremer