Open-EO / Open-EO/openeo-python-driver

make LoadParameters immutable

Open
#140 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12
Forks
8
Avg merge
6d 3h
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare LoadParameters with EvalEnv, then inspect the LoadParameters usage in openeogeotrellis/layercatalog.py around lines 79-81 and the linked caching behavior. Make LoadParameters immutable so mutations cannot alter cache keys, and verify that cache lookups no longer return values for the old key.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.