Open-EO / openeo-python-driver

Common parts of a Python driver implementation for OpenEO
Apache License 2.0
11 stars 6 forks source link

make LoadParameters immutable #140

Open bossie opened 2 years ago

bossie commented 2 years ago

load_collection caching was fixed as part of https://github.com/Open-EO/openeo-geotrellis-extensions/issues/74; this made an issue apparent with LoadParameters: a mutable object that's part of a cache key has some undesired consequences.

In this case mutating the existing LoadParameters object also modified it it the cache key, and getting a value from the cache with the new cache key returned the value for the old cache key.

Making LoadParameters immutable like EvalEnv would prevent this kind of mistakes.

soxofaan commented 2 years ago

Immutability FTW!