diff --git a/xee/ext.py b/xee/ext.py index 65bd9e0..680398e 100644 --- a/xee/ext.py +++ b/xee/ext.py @@ -331,6 +331,9 @@ def open_store_variable(self, name: str) -> xarray.Variable: x_dim_name, y_dim_name = self.dimension_names dimensions = [self.primary_dim_name, x_dim_name, y_dim_name] attrs = self._band_attrs(name) + # Convert 'data_type' attribute to string to make it valid for the dataset. + if attrs.get('data_type'): + attrs['data_type'] = str(attrs['data_type']) encoding = { 'source': attrs['id'], 'scale_factor': arr.scale,