File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,11 @@ def keys(self) -> Set[str]:
161
161
162
162
varnames = list (self .axes ) + list (self .coordinates )
163
163
try :
164
- varnames .extend (list (self .custom_keys ))
164
+ # see which custom keys have matched values in object
165
+ matched_keys = [
166
+ key for key , val in self .custom_keys .items () if len (val ) > 0
167
+ ]
168
+ varnames .extend (matched_keys )
165
169
except ValueError :
166
170
# don't have criteria defined, then no custom keys to report
167
171
pass
Original file line number Diff line number Diff line change 16
16
"temp2" : {
17
17
"standard_name" : "temp$" ,
18
18
},
19
+ "salt2" : {"standard_name" : "sal$" },
19
20
}
20
21
21
22
@@ -73,6 +74,7 @@ def test_match_criteria_key_accessor():
73
74
]
74
75
assert "X" in df .cf
75
76
assert "Y" not in df .cf
77
+ assert "salt2" not in df .cf
76
78
77
79
78
80
@mock .patch ("requests.get" )
You can’t perform that action at this time.
0 commit comments