Skip to content

Commit 803fa2b

Browse files
committed
Issue #641 avoid SettingWithCopyWarning
by making the `copy()` explicit
1 parent 202408b commit 803fa2b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
- `MultiBackendJobManager`: Fix issue with duplicate job starting across multiple backends ([#654](https://github.com/Open-EO/openeo-python-client/pull/654))
2121
- `MultiBackendJobManager`: Fix encoding issue of job metadata in `on_job_done` ([#657](https://github.com/Open-EO/openeo-python-client/issues/657))
22+
- `MultiBackendJobManager`: Avoid `SettingWithCopyWarning` ([#641](https://github.com/Open-EO/openeo-python-client/issues/641))
2223

2324

2425
## [0.34.0] - 2024-10-31

openeo/extra/job_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def _job_update_loop(
492492
self._track_statuses(job_db, stats=stats)
493493
stats["track_statuses"] += 1
494494

495-
not_started = job_db.get_by_status(statuses=["not_started"], max=200)
495+
not_started = job_db.get_by_status(statuses=["not_started"], max=200).copy()
496496
if len(not_started) > 0:
497497
# Check number of jobs running at each backend
498498
running = job_db.get_by_status(statuses=["created", "queued", "running"])
@@ -666,7 +666,7 @@ def _track_statuses(self, job_db: JobDatabaseInterface, stats: Optional[dict] =
666666
"""
667667
stats = stats if stats is not None else collections.defaultdict(int)
668668

669-
active = job_db.get_by_status(statuses=["created", "queued", "running"])
669+
active = job_db.get_by_status(statuses=["created", "queued", "running"]).copy()
670670
for i in active.index:
671671
job_id = active.loc[i, "id"]
672672
backend_name = active.loc[i, "backend_name"]

0 commit comments

Comments
 (0)