apache / apache/hugegraph-ai

[Feature vermeer-python-client] TaskInfo does not parse error_message field from task response

Open Beginner friendly
#371 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
143
Forks
89
PR merge metrics
No merged PRs in 30d

Description

### Search before asking

- [x] I had searched in the [feature](https://github.com/apache/hugegraph-ai/issues?q=is%3Aissue+label%3A%22Feature%22) and found no similar feature requirement.

### Feature Description (功能描述)

The Vermeer REST API already returns an error_message field in the task response when a task fails (e.g., for load or compute tasks). However, the Python client (vermeer-python-client) does not parse this field. The TaskInfo class ignores error_message, making it difficult for users to understand why a task failed without manually inspecting the raw HTTP response.
vermeer-python-client/src/pyvermeer/structure/task_data.py

```
class TaskInfo:
"""task info"""

def __init__(self, dic):
"""init"""
self.__id = dic.get("id", 0)
self.__status = dic.get("status", "")
self.__state = dic.get("state", "")
self.__create_user = dic.get("create_user", "")
self.__create_type = dic.get("create_type", "")
self.__create_time = parse_vermeer_time(dic.get("create_time", ""))
self.__start_time = parse_vermeer_time(dic.get("start_time", ""))
self.__update_time = parse_vermeer_time(dic.get("update_time", ""))
self.__graph_name = dic.get("graph_name", "")
self.__space_name = dic.get("space_name", "")
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", ""),

def to_dict(self) -> dict:
"""to dict"""
return {
"id": self.__id,
"status": self.__status,
"state": self.__state,
"create_user": self.__create_user,
"create_type": self.__create_type,
"create_time": self.__create_time.strftime("%Y-%m-%d %H:%M:%S") if self.__start_time else "",
"start_time": self.__start_time.strftime("%Y-%m-%d %H:%M:%S") if self.__start_time else "",
"update_time": self.__update_time.strftime("%Y-%m-%d %H:%M:%S") if self.__update_time else "",
"graph_name": self.__graph_name,
"space_name": self.__space_name,
"type": self.__type,
"params": self.__params,
"workers": [w.to_dict() for w in self.__workers],
"error_message": self.__error_message,
}
```

### Are you willing to submit a PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in vermeer-python-client/src/pyvermeer/structure/task_data.py at TaskInfo.__init__ and to_dict, then inspect how task responses are consumed by the Python client. Confirm that error_message from load or compute task responses is exposed as the expected value rather than being ignored or altered, and verify the resulting task data representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.