From 89d68c88a49148499bacdd9b45206c5442973e5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 06:11:00 +0000 Subject: [PATCH 1/3] Initial plan From e2d2a1f680624b6e293a3bf626dc4f1fada16897 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 06:14:15 +0000 Subject: [PATCH 2/3] Add stacktrace field to LogEntry (openEO API v1.3) Agent-Logs-Url: https://github.com/Open-EO/openeo-python-client/sessions/fcd7c627-939e-4125-bf0c-a29c745cd108 Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com> --- openeo/rest/models/logs.py | 6 ++++++ tests/rest/models/test_logs.py | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/openeo/rest/models/logs.py b/openeo/rest/models/logs.py index 25a43d263..ee56cd0d4 100644 --- a/openeo/rest/models/logs.py +++ b/openeo/rest/models/logs.py @@ -22,6 +22,7 @@ class LogEntry(dict): between None and non-existing. None for example refers to no-data in many cases while the absence of the property means that the user did not provide any data for debugging. + - ``stacktrace``: Stacktrace for the error, array of strings, available since API 1.3.0 """ _required = {"id", "level", "message"} @@ -49,6 +50,11 @@ def message(self): def level(self): return self["level"] + @property + def stacktrace(self) -> list: + """Stacktrace for the error, available since API 1.3.0. Returns an empty list if not present.""" + return self.get("stacktrace", []) + # TODO: add properties for "code", "time", "path", "links" and "data" with sensible defaults? diff --git a/tests/rest/models/test_logs.py b/tests/rest/models/test_logs.py index 48312d38a..1ceabd3a2 100644 --- a/tests/rest/models/test_logs.py +++ b/tests/rest/models/test_logs.py @@ -36,6 +36,22 @@ def test_log_entry_legacy(): assert log.log_id == "log01" +def test_log_entry_stacktrace_missing(): + log = LogEntry(id="log01", level="error", message="oops") + assert log.stacktrace == [] + + +def test_log_entry_stacktrace_present(): + log = LogEntry( + id="log01", + level="error", + message="oops", + stacktrace=["line 1", "line 2", "line 3"], + ) + assert log.stacktrace == ["line 1", "line 2", "line 3"] + assert log["stacktrace"] == ["line 1", "line 2", "line 3"] + + @pytest.mark.parametrize( ["log_level_in", "expected_log_level"], [ From b5059cacd8660124a8161528805cefc34b6333b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:07:46 +0000 Subject: [PATCH 3/3] Fix stacktrace: optional string (None default), not array Agent-Logs-Url: https://github.com/Open-EO/openeo-python-client/sessions/b2f20f19-3428-49ca-a0c4-5d55f0a22c6d Co-authored-by: soxofaan <44946+soxofaan@users.noreply.github.com> --- openeo/rest/models/logs.py | 8 ++++---- tests/rest/models/test_logs.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openeo/rest/models/logs.py b/openeo/rest/models/logs.py index ee56cd0d4..aedddd0bc 100644 --- a/openeo/rest/models/logs.py +++ b/openeo/rest/models/logs.py @@ -22,7 +22,7 @@ class LogEntry(dict): between None and non-existing. None for example refers to no-data in many cases while the absence of the property means that the user did not provide any data for debugging. - - ``stacktrace``: Stacktrace for the error, array of strings, available since API 1.3.0 + - ``stacktrace``: Stacktrace for the error, string, optional, available since API 1.3.0 """ _required = {"id", "level", "message"} @@ -51,9 +51,9 @@ def level(self): return self["level"] @property - def stacktrace(self) -> list: - """Stacktrace for the error, available since API 1.3.0. Returns an empty list if not present.""" - return self.get("stacktrace", []) + def stacktrace(self) -> Union[str, None]: + """Stacktrace for the error, available since API 1.3.0. Returns None if not present.""" + return self.get("stacktrace", None) # TODO: add properties for "code", "time", "path", "links" and "data" with sensible defaults? diff --git a/tests/rest/models/test_logs.py b/tests/rest/models/test_logs.py index 1ceabd3a2..0bc346f66 100644 --- a/tests/rest/models/test_logs.py +++ b/tests/rest/models/test_logs.py @@ -38,7 +38,7 @@ def test_log_entry_legacy(): def test_log_entry_stacktrace_missing(): log = LogEntry(id="log01", level="error", message="oops") - assert log.stacktrace == [] + assert log.stacktrace is None def test_log_entry_stacktrace_present(): @@ -46,10 +46,10 @@ def test_log_entry_stacktrace_present(): id="log01", level="error", message="oops", - stacktrace=["line 1", "line 2", "line 3"], + stacktrace="line 1\nline 2\nline 3", ) - assert log.stacktrace == ["line 1", "line 2", "line 3"] - assert log["stacktrace"] == ["line 1", "line 2", "line 3"] + assert log.stacktrace == "line 1\nline 2\nline 3" + assert log["stacktrace"] == "line 1\nline 2\nline 3" @pytest.mark.parametrize(