`xds_to_zarr` behaviour when selecting columns
JSKenyon opened this issue · comments
- dask-ms version: 0.2.8
- Python version: 3.8.10
- Operating System: Ubuntu 20.04 LTS
Description
While debugging #172, I noticed that the behaviour of xds_to_zarr
is a little unexpected when selecting columns. Specifically, selecting a column doesn't imply selection of its coordinates. This makes is necessary to specify each coordinate array separately. This is tedious and at odds with 'normal' xarray behaviour, in that we can end up writing a dataset where all the coordinates are zero.
I propose changing this behaviour so that xds_to_zarr(..., columns=...)
only selects from data_vars and then automatically includes the associated coordinates. Users who require the old behaviour (unlikely though it seems) could simply drop the relevant values before writing. @landmanbester Does this seem more sensible to you?