Skip to content

Error on reading arraylake derived zarr store #168

Description

@ahuang11

Read this https://www.earthmover.io/blog/virtual-zarr looked cool, and was testing

import arraylake as al
import xarray as xr
import xarray_sql as xql

client = al.Client()
client.login()

repo = client.get_repo("earthmover-public/goes-16")
session = repo.readonly_session("main")
ds = xr.open_zarr(session.store, group="ABI-L2-MCMIPF/post-2023-04-19")
xql.read_xarray(ds)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[9], line 11
      7 
      8 repo = client.get_repo("earthmover-public/goes-16")
      9 session = repo.readonly_session("main")
     10 ds = xr.open_zarr(session.store, group="ABI-L2-MCMIPF/post-2023-04-19")
---> 11 xql.read_xarray(ds)

File ~/miniconda3/envs/lumen/lib/python3.12/site-packages/xarray_sql/reader.py:184, in read_xarray(ds, chunks)
    171 def read_xarray(ds: xr.Dataset, chunks: Chunks = None) -> pa.RecordBatchReader:
    172     """Pivots an Xarray Dataset into a PyArrow Table, partitioned by chunks.
    173 
    174     Args:
   (...)    182       Dataset.
    183     """
--> 184     reader = XarrayRecordBatchReader(ds, chunks=chunks)
    185     return pa.RecordBatchReader.from_stream(reader)

File ~/miniconda3/envs/lumen/lib/python3.12/site-packages/xarray_sql/reader.py:93, in XarrayRecordBatchReader.__init__(self, ds, chunks, batch_size, _iteration_callback)
     91 fst = next(iter(ds.values())).dims
     92 if not all(da.dims == fst for da in ds.values()):
---> 93     raise ValueError(
     94         "All dimensions must be equal. Please filter data_vars in the Dataset."
     95     )

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

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