Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprintfix: 兼容节点 READY 的 case #7142

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gcloud/taskflow3/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,10 @@ def get_node_detail(
detail = node_detail_result["data"]
detail.update(node_data)

if not detail.get("id"):
# 没有 ID 说明流程尚未创建完成,直接返回,无需补充额外的配置信息
return {"result": True, "data": detail, "message": "", "code": err_code.SUCCESS.code}

# 补充重试信息
detail["auto_retry_info"] = (
fetch_node_id__auto_retry_info_map(detail["parent_id"], [detail["id"]]).get(detail["id"]) or {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_include_data_is_false(self):
taskflow.has_node = MagicMock(return_value=True)
dispatcher = MagicMock()
get_node_data_return = {"result": True, "data": {}}
get_node_detail_return = {"result": True, "data": {"id": "id", "parent_id": "parent_id"}}
get_node_detail_return = {"result": True, "data": {}}
dispatcher.get_node_data = MagicMock(return_value=get_node_data_return)
dispatcher.get_node_detail = MagicMock(return_value=get_node_detail_return)
dispatcher_init = MagicMock(return_value=dispatcher)
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_include_data_is_false(self):
detail,
{
"code": 0,
"data": {"auto_retry_info": {}, "id": "id", "parent_id": "parent_id"},
"data": {},
"message": "",
"result": True,
},
Expand Down
Loading