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

zihaoxiang pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3149928cdc Modify the documentation that python task will not work 
properly when '\n' indicates the presence of a variable and needs to use 
'repr(value)' (#15145)
3149928cdc is described below

commit 3149928cdcde0007b03ab98bc42063d631e52988
Author: kevinkelin <[email protected]>
AuthorDate: Wed Nov 15 09:30:37 2023 +0800

    Modify the documentation that python task will not work properly when '\n' 
indicates the presence of a variable and needs to use 'repr(value)' (#15145)
    
    Co-authored-by: yangyanxing <[email protected]>
    Co-authored-by: xiangzihao <[email protected]>
---
 docs/docs/en/guide/parameter/context.md | 3 +++
 docs/docs/zh/guide/parameter/context.md | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/docs/docs/en/guide/parameter/context.md 
b/docs/docs/en/guide/parameter/context.md
index ac86014c45..428485e0f1 100644
--- a/docs/docs/en/guide/parameter/context.md
+++ b/docs/docs/en/guide/parameter/context.md
@@ -92,6 +92,9 @@ For example
 
 
![python_context_param](../../../../img/new_ui/dev/parameter/python_context_param.png)
 
+
+Attention: When the variable value contains the `\n` identifier, such as ` 
value = "hello \n world" `, value needs to be carried out in a special way. You 
need to use `print('${setValue(key=%s)}' % repr(value))`, otherwise the 
argument cannot be passed to the subsequent flow.
+
 #### Pass parameter from SubProcess task to downstream
 
 In the workflow definition of the subprocess, define `OUT` direction 
parameters as output parameters, and these parameters can be passed to the 
downstream tasks of the subprocess node.
diff --git a/docs/docs/zh/guide/parameter/context.md 
b/docs/docs/zh/guide/parameter/context.md
index efcd576a54..10470c22b7 100644
--- a/docs/docs/zh/guide/parameter/context.md
+++ b/docs/docs/zh/guide/parameter/context.md
@@ -91,6 +91,10 @@ Node_mysql 运行结果如下:
 如
 
![python_context_param](../../../../img/new_ui/dev/parameter/python_context_param.png)
 
+
+注意: 当变量 value 中含有 `\n` 标识,如 `value = "hello \n world"`, 则需要将 value 进行特殊进行,需要使用 
`print('${setValue(key=%s)}' % repr(value))`, 否则参数无法传递到后面的流程。
+
+
 #### SubProcess 任务传递参数
 
 在子流程的工作流定义中定义方向是 OUT 的变量作为输出参数,可以将这些参数传递到子流程节点的下游任务。

Reply via email to