File tree 3 files changed +10
-1
lines changed 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 2
2
Changelog for eccodes-python
3
3
============================
4
4
5
+ 2.41.1 (2025-mm-dd)
6
+ --------------------
7
+
8
+ - ECC-2072: high-level 'get' function should return default value if key is not implemented
9
+
10
+
5
11
2.41.0 (2025-04-10)
6
12
--------------------
7
13
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def raise_keyerror(name):
17
17
"""Make operations on a key raise a KeyError if not found"""
18
18
try :
19
19
yield
20
- except eccodes .KeyValueNotFoundError :
20
+ except ( eccodes .KeyValueNotFoundError , eccodes . FunctionNotImplementedError ) :
21
21
raise KeyError (name )
22
22
23
23
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ def test_message_get():
44
44
assert message ["gridType:int" ] == 0
45
45
with pytest .raises (KeyError ):
46
46
message ["invalid" ]
47
+ with pytest .raises (KeyError ):
48
+ message ["gridSpec" ]
49
+ assert message .get ("gridSpec" , dummy_default ) is dummy_default
47
50
# keys set as MISSING
48
51
assert message .is_missing (known_missing )
49
52
assert message .get (known_missing ) is None
You can’t perform that action at this time.
0 commit comments