diff --git a/xarray/core/utils.py b/xarray/core/utils.py index 5570f9e9a80..896ee31ab5c 100644 --- a/xarray/core/utils.py +++ b/xarray/core/utils.py @@ -343,7 +343,7 @@ def dict_equiv( return True -def ordered_dict_intersection( +def compat_dict_intersection( first_dict: Mapping[K, V], second_dict: Mapping[K, V], compat: Callable[[V, V], bool] = equivalent, @@ -361,9 +361,6 @@ def ordered_dict_intersection( Binary operator to determine if two values are compatible. By default, checks for equivalence. - # TODO: Rename to compat_dict_intersection, as we do not use OrderedDicts - # any more. - Returns ------- intersection : dict diff --git a/xarray/tests/test_utils.py b/xarray/tests/test_utils.py index ddca6c57064..5f8b1770bd3 100644 --- a/xarray/tests/test_utils.py +++ b/xarray/tests/test_utils.py @@ -120,9 +120,9 @@ def test_unsafe(self): with pytest.raises(ValueError): utils.update_safety_check(self.x, self.z) - def test_ordered_dict_intersection(self): - assert {"b": "B"} == utils.ordered_dict_intersection(self.x, self.y) - assert {} == utils.ordered_dict_intersection(self.x, self.z) + def test_compat_dict_intersection(self): + assert {"b": "B"} == utils.compat_dict_intersection(self.x, self.y) + assert {} == utils.compat_dict_intersection(self.x, self.z) def test_compat_dict_union(self): assert {"a": "A", "b": "B", "c": "C"} == utils.compat_dict_union(self.x, self.y)