diff --git a/dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py b/dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py index b47b8e3bfd..9a13854887 100644 --- a/dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py +++ b/dolphinscheduler-python/pydolphinscheduler/examples/task_switch_example.py @@ -36,6 +36,14 @@ from pydolphinscheduler.tasks.switch import Branch, Default, Switch, SwitchCondi with ProcessDefinition( name="task_switch_example", tenant="tenant_exists", + param=[ + { + "prop": "var", + "direct": "IN", + "type": "VARCHAR", + "value": "1" + } + ] ) as pd: parent = Shell(name="parent", command="echo parent") switch_child_1 = Shell(name="switch_child_1", command="echo switch_child_1") diff --git a/dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py b/dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py index 711cfb0b0f..f6fab01d3d 100644 --- a/dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py +++ b/dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/process_definition.py @@ -332,7 +332,7 @@ class ProcessDefinition(Base): self._project, self.name, 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.task_location), self.timeout,