File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def _apply_single_mapper(mapper):
99
99
100
100
try :
101
101
results = mapper (obj , key )
102
- except KeyError as e :
102
+ except ( KeyError , ValueError ) as e :
103
103
if error or "I expected only one." in repr (e ):
104
104
raise e
105
105
else :
@@ -621,6 +621,7 @@ def _getitem(
621
621
"""
622
622
623
623
obj = accessor ._obj
624
+ all_bounds = obj .cf .bounds if isinstance (obj , Dataset ) else {}
624
625
kind = str (type (obj ).__name__ )
625
626
scalar_key = isinstance (key , str )
626
627
@@ -638,7 +639,7 @@ def drop_bounds(names):
638
639
if not isinstance (obj , DataArray ) and scalar_key :
639
640
bounds = set ()
640
641
for name in names :
641
- bounds .update (obj . cf . bounds .get (name , []))
642
+ bounds .update (all_bounds .get (name , []))
642
643
names = set (names ) - bounds
643
644
return names
644
645
You can’t perform that action at this time.
0 commit comments