This is an automated email from the ASF dual-hosted git repository.
zhongjiajie pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/dolphinscheduler-sdk-python.git
The following commit(s) were added to refs/heads/main by this push:
new b15c716 impv: added multiple lines shell example (#133)
b15c716 is described below
commit b15c716821cdd39e150cdc61402996a2af3178b0
Author: Harshit Nagpal <[email protected]>
AuthorDate: Sun Jan 14 08:17:46 2024 +0530
impv: added multiple lines shell example (#133)
---
src/pydolphinscheduler/examples/tutorial.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/pydolphinscheduler/examples/tutorial.py
b/src/pydolphinscheduler/examples/tutorial.py
index 9519d8e..8261b01 100644
--- a/src/pydolphinscheduler/examples/tutorial.py
+++ b/src/pydolphinscheduler/examples/tutorial.py
@@ -15,8 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-r"""
-A tutorial example take you to experience pydolphinscheduler.
+r"""A tutorial example take you to experience pydolphinscheduler.
After tutorial.py file submit to Apache DolphinScheduler server a DAG would be
create,
and workflow DAG graph as below:
@@ -49,7 +48,15 @@ with Workflow(
# [end workflow_declare]
# [start task_declare]
task_parent = Shell(name="task_parent", command="echo hello
pydolphinscheduler")
- task_child_one = Shell(name="task_child_one", command="echo 'child one'")
+ task_child_one = Shell(
+ name="task_child_one",
+ command="""
+ echo "Executing line 1 with parameter str type ${param1}"
+ echo "Executing line 2 with parameter int type ${param2}"
+ echo "Executing line 3 with parameter build-in parameter currently
date ${param3}"
+ """,
+ params={"param1": "str1", "param2": 123, "param3": "$[yyyy-MM-dd]"},
+ )
task_child_two = Shell(name="task_child_two", command="echo 'child two'")
task_union = Shell(name="task_union", command="echo union")