import xarray as xr
import xarray_sql as xql
ds = xr.tutorial.open_dataset('air_temperature')
ctx = xql.XarrayContext()
ctx.from_dataset('air', ds, chunks=dict(time=100))
clim = ctx.sql('''
SELECT
"time", AVG("air") AS air
FROM
"air"
GROUP BY
"time"
''')
clim_ds = clim.to_dataset()
To my surprise: ValueError: dims cannot be inferred: no registered Dataset has all of its dims present in the result columns. Pass dims=[...] explicitly.
I imagine the value for group by would become the dim here?
To my surprise:
ValueError: dims cannot be inferred: no registered Dataset has all of its dims present in the result columns. Pass dims=[...] explicitly.I imagine the value for
group bywould become the dim here?