Skip to content

read_xarray doesn't work on all xarray datasets #180

Description

@ahuang11
ds = xr.open_zarr(
  'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3',
  chunks=None,  # Turn dask off
  storage_options={'token': 'anon'}  # Anonymous read from the public GCS bucket — no auth required.
)
xql.read_xarray(ds)
File ~/repos/xarray-sql/xarray_sql/reader.py:96, in XarrayRecordBatchReader.__init__(self, ds, chunks, batch_size, _iteration_callback)
     94 fst = next(iter(ds.values())).dims
     95 if not all(da.dims == fst for da in ds.values()):
---> [96](https://file+.vscode-resource.vscode-cdn.net/Users/ahuang/repos/xarray-sql/~/repos/xarray-sql/xarray_sql/reader.py:96)     raise ValueError(
     97         "All dimensions must be equal. Please filter data_vars in the Dataset."
     98     )

ValueError: All dimensions must be equal. Please filter data_vars in the Dataset.

So, I tried:

xql.read_xarray(ds, data_vars=["surface"])

But data_vars isn't a kwarg.

Should read_xarray have an option to pass data_vars?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions