You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using xcube-stac to open data published by xcube server calculations on the fly add new data variables raises an error, if mldataset is desired. xcube-stac renames variables to distinguish data variables of different assets sharing the same name. When calculations are performed on a dataset where data variables are added, the renaming dictionary picks those names. However when actually accessing the data source with mlds.get_dataset(idx_level), the original dataset is opened, which does not have these data variable, resulting in an error.
To Reproduce
Steps to reproduce the behavior:
run xcube server demo example: xcube serve -vvv -c examples/serve/demo/config.yml
Traceback (most recent call last):
File "/home/konstantin/bc_kon/01_coding/00_testing/error_xcube_server.py", line 6, in <module>
ds = mlds.get_dataset(2)
^^^^^^^^^^^^^^^^^^^
File "/home/konstantin/micromamba/envs/xcube-stac/lib/python3.12/site-packages/xcube/core/mldataset/lazy.py", line 92, in get_dataset
level_dataset = self._get_dataset_lazily(index, self._parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/konstantin/micromamba/envs/xcube-stac/lib/python3.12/site-packages/xcube/core/mldataset/mapped.py", line 32, in _get_dataset_lazily
return self._mapper_function(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/konstantin/bc_kon/01_coding/01_github/xcube-stac/xcube_stac/utils.py", line 508, in _xarray_rename_vars
return ds.rename_vars(name_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/konstantin/micromamba/envs/xcube-stac/lib/python3.12/site-packages/xarray/core/dataset.py", line 4396, in rename_vars
raise ValueError(
ValueError: cannot rename 'lat_bnds' because it is not a variable or coordinate in this dataset
Expected behavior
Levels of multi-level datasets shall be opened without error.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using xcube-stac to open data published by xcube server calculations on the fly add new data variables raises an error, if mldataset is desired. xcube-stac renames variables to distinguish data variables of different assets sharing the same name. When calculations are performed on a dataset where data variables are added, the renaming dictionary picks those names. However when actually accessing the data source with
mlds.get_dataset(idx_level)
, the original dataset is opened, which does not have these data variable, resulting in an error.To Reproduce
Steps to reproduce the behavior:
xcube serve -vvv -c examples/serve/demo/config.yml
Returned error:
Expected behavior
Levels of multi-level datasets shall be opened without error.
The text was updated successfully, but these errors were encountered: