diff --git a/satpy/modifiers/angles.py b/satpy/modifiers/angles.py index 01e7c1ff2d..02ffadfa87 100644 --- a/satpy/modifiers/angles.py +++ b/satpy/modifiers/angles.py @@ -248,7 +248,8 @@ def _hash_args(*args, unhashable_types=DEFAULT_UNCACHE_TYPES): hashable_args = [] for arg in args: if isinstance(arg, unhashable_types): - raise TypeError(f"Unhashable type in function signature ({type(arg)}), cannot be cached.") + warnings.warn(f"Unhashable type in function signature ({type(arg)}), cannot be cached.", stacklevel=2) + continue if isinstance(arg, HASHABLE_GEOMETRIES): arg = hash(arg) elif isinstance(arg, datetime): diff --git a/satpy/tests/modifier_tests/test_angles.py b/satpy/tests/modifier_tests/test_angles.py index 46a8a8443f..4c7e295e14 100644 --- a/satpy/tests/modifier_tests/test_angles.py +++ b/satpy/tests/modifier_tests/test_angles.py @@ -330,7 +330,7 @@ def test_caching_with_array_in_args_fails(self, tmp_path): def _fake_func(array): return array + 1 - with pytest.raises(TypeError), \ + with pytest.warns(UserWarning), \ satpy.config.set(cache_lonlats=True, cache_dir=str(tmp_path)): _fake_func(da.zeros(100))