Skip to content

Commit

Permalink
Use get to fetch units attribute to avoid error if missing. (geopytho…
Browse files Browse the repository at this point in the history
  • Loading branch information
huard authored Feb 23, 2024
1 parent c85d600 commit b54bdd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygeoapi/provider/xarray_.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ def _get_coverage_properties(self):
if coord.lower() == 'time':
time_var = coord
continue
if self._data.coords[coord].attrs['units'] == 'degrees_north':
if self._data.coords[coord].attrs.get('units') == 'degrees_north':
y_var = coord
continue
if self._data.coords[coord].attrs['units'] == 'degrees_east':
if self._data.coords[coord].attrs.get('units') == 'degrees_east':
x_var = coord
continue

Expand Down

0 comments on commit b54bdd8

Please sign in to comment.