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

fix: 修复任务未执行节点预览时免渲染表单项中变量仍被渲染问题 #7358 #7383

Open
wants to merge 5 commits into
base: release_humming_bird
Choose a base branch
from
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
hooks:
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: stable
rev: 22.8.0
hooks:
- id: black
language_version: python3.6
Expand Down
3 changes: 2 additions & 1 deletion gcloud/tasktmpl3/domains/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def get_need_render_context_keys():
else:
raise Exception(f"can not preview inputs for node type: {node_type}")
raw_inputs = {key: info["value"] for key, info in raw_inputs.items()}
hydrated_context = context.hydrate(deformat=True)
need_render = pipeline["activities"][node_id]["component"]["inputs"]["job_content"]["need_render"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个处理方式不通用,job_content不是每个 input 都有的,会出现 keyerror

hydrated_context = context.hydrate(deformat=need_render)
inputs = Template(raw_inputs).render(hydrated_context)
return inputs

Expand Down
Loading