Skip to content

Commit 35b71e9

Browse files
committed
More cleanup
1 parent 7a9a16a commit 35b71e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cf_xarray/accessor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
# Type for Mapper functions
116116
Mapper = Callable[
117117
[Union[xr.DataArray, xr.Dataset], str, bool, str],
118-
Union[Optional[str], List[Optional[str]], DataArray], # this sucks
118+
Union[List[Optional[str]], DataArray], # this sucks
119119
]
120120

121121

@@ -372,7 +372,7 @@ def _getattr(
372372
newmap = dict()
373373
unused_keys = set(attribute.keys())
374374
for key in _AXIS_NAMES + _COORD_NAMES:
375-
value = _get_axis_coord(obj, key, error=False, default=None)
375+
value = _get_axis_coord(obj, key, error=False)
376376
unused_keys -= set(value)
377377
if value != [None]:
378378
good_values = set(value) & set(obj.dims)
@@ -694,13 +694,13 @@ def get_valid_keys(self) -> Set[str]:
694694
varnames = [
695695
key
696696
for key in _AXIS_NAMES + _COORD_NAMES
697-
if _get_axis_coord(self._obj, key, error=False, default=None) != [None]
697+
if _get_axis_coord(self._obj, key, error=False) != [None]
698698
]
699699
with suppress(NotImplementedError):
700700
measures = [
701701
key
702702
for key in _CELL_MEASURES
703-
if _get_measure(self._obj, key, error=False, default=None) != [None]
703+
if _get_measure(self._obj, key, error=False) != [None]
704704
]
705705
if measures:
706706
varnames.extend(measures)

0 commit comments

Comments
 (0)