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
I encountered an issue when loading a subset of variables from a view:
This error occurs when one tries to select variables from the view and its reference but with different dimensions. I think the problem is that the two datasets (one from the view, one from the reference) are loaded then merged, but if the dimensions does not match the merging process fails.
Below is a simple example to reproduce the issue. The core of the example is that we load a 1D variable from the reference and a 2D variable from the view:
from __future__ importannotationsfromtypingimportIteratorimportdatetimeimportpprintimportdask.distributedasdistimportfsspecimportnumpyimportzcollectionaszcimportzcollection.tests.dataaszc_data# Create collectionzds=next(zc_data.create_test_dataset_with_fillvalue())
fs=fsspec.filesystem('memory')
cluster=dist.LocalCluster(processes=False)
client=dist.Client(cluster)
partition_handler=zc.partitioning.Date(('time', ), resolution='M')
collection=zc.create_collection('time', zds, partition_handler, '/my_collection', filesystem=fs)
collection.insert(zds)
# Create viewnew_var=zds.metadata().variables['var1']
new_var_config=new_var.get_config()
new_var_config['name'] ='var_view'new_var=new_var.from_config(new_var_config)
view=zc.create_view('/my_view', zc.ViewReference(collection.partition_properties.dir, filesystem=fs), filesystem=fs)
view.add_variable(new_var)
# Query everything, this works properlyview.load()
# Query a 'bad' set of variables -> ValueErrorview.load(selected_variables=['time', 'var_view'])
The text was updated successfully, but these errors were encountered:
Hi,
I encountered an issue when loading a subset of variables from a view:
This error occurs when one tries to select variables from the view and its reference but with different dimensions. I think the problem is that the two datasets (one from the view, one from the reference) are loaded then merged, but if the dimensions does not match the merging process fails.
Below is a simple example to reproduce the issue. The core of the example is that we load a 1D variable from the reference and a 2D variable from the view:
The text was updated successfully, but these errors were encountered: