Skip to content

Commit

Permalink
Ensure 'data_type' attribute is a string to make it valid for the dat…
Browse files Browse the repository at this point in the history
…aset.

Fixes #49.

PiperOrigin-RevId: 571994074
  • Loading branch information
Xee authors committed Oct 9, 2023
1 parent 744491f commit eb39a84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xee/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit eb39a84

Please sign in to comment.