Browse Source

[python] Fix task switch set global parameter (#7693)

* [python] Fix task switch set global parameter

* Change name
2.0.7-release
Jiajie Zhong 3 years ago committed by GitHub
parent
commit
24747b3dae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py
  2. 2
      dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py

8
dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py

@ -36,6 +36,14 @@ from pydolphinscheduler.tasks.switch import Branch, Default, Switch, SwitchCondi
with ProcessDefinition( with ProcessDefinition(
name="task_switch_example", name="task_switch_example",
tenant="tenant_exists", tenant="tenant_exists",
param=[
{
"prop": "var",
"direct": "IN",
"type": "VARCHAR",
"value": "1"
}
]
) as pd: ) as pd:
parent = Shell(name="parent", command="echo parent") parent = Shell(name="parent", command="echo parent")
switch_child_1 = Shell(name="switch_child_1", command="echo switch_child_1") switch_child_1 = Shell(name="switch_child_1", command="echo switch_child_1")

2
dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py

@ -332,7 +332,7 @@ class ProcessDefinition(Base):
self._project, self._project,
self.name, self.name,
str(self.description) if self.description else "", str(self.description) if self.description else "",
str(self.param) if self.param else None, json.dumps(self.param) if self.param else None,
json.dumps(self.schedule_json) if self.schedule_json else None, json.dumps(self.schedule_json) if self.schedule_json else None,
json.dumps(self.task_location), json.dumps(self.task_location),
self.timeout, self.timeout,

Loading…
Cancel
Save