You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2026/09/25 15:18:28 UTC

(hugegraph-ai) branch main updated: fix(vermeer): parse task error_message (#375)

This is an automated email from the ASF dual-hosted git repository.

imbajin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hugegraph-ai.git


The following commit(s) were added to refs/heads/main by this push:
     new 8aabd413 fix(vermeer): parse task error_message (#375)
8aabd413 is described below

commit 8aabd4131d08e47d918bb6e831b9b9eee4ace9b1
Author: Dang Pham <ph...@gmail.com>
AuthorDate: Fri Sep 25 22:18:23 2026 +0700

    fix(vermeer): parse task error_message (#375)
---
 .../src/pyvermeer/structure/task_data.py           |  7 +++++
 .../src/tests/structure/test_task_data.py          | 32 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/vermeer-python-client/src/pyvermeer/structure/task_data.py b/vermeer-python-client/src/pyvermeer/structure/task_data.py
index 4cf0aa22..c245df6a 100644
--- a/vermeer-python-client/src/pyvermeer/structure/task_data.py
+++ b/vermeer-python-client/src/pyvermeer/structure/task_data.py
@@ -62,6 +62,7 @@ class TaskInfo:
         self.__type = dic.get("type", "")
         self.__params = dic.get("params", {})
         self.__workers = [TaskWorker(w) for w in dic.get("workers", [])]
+        self.__error_message = dic.get("error_message", "")
 
     @property
     def id(self) -> int:
@@ -123,6 +124,11 @@ class TaskInfo:
         """task workers"""
         return self.__workers
 
+    @property
+    def error_message(self) -> str:
+        """task error message"""
+        return self.__error_message
+
     def to_dict(self) -> dict:
         """to dict"""
         return {
@@ -139,6 +145,7 @@ class TaskInfo:
             "type": self.__type,
             "params": self.__params,
             "workers": [w.to_dict() for w in self.__workers],
+            "error_message": self.__error_message,
         }
 
 
diff --git a/vermeer-python-client/src/tests/structure/test_task_data.py b/vermeer-python-client/src/tests/structure/test_task_data.py
new file mode 100644
index 00000000..f1478ba5
--- /dev/null
+++ b/vermeer-python-client/src/tests/structure/test_task_data.py
@@ -0,0 +1,32 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from pyvermeer.structure.task_data import TaskInfo
+
+
+def test_task_info_preserves_error_message():
+    task = TaskInfo({"error_message": "task failed"})
+
+    assert task.error_message == "task failed"
+    assert task.to_dict()["error_message"] == "task failed"
+
+
+def test_task_info_defaults_missing_error_message_to_empty_string():
+    task = TaskInfo({"status": "success", "state": "success"})
+
+    assert task.error_message == ""
+    assert task.to_dict()["error_message"] == ""