You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/01/04 11:38:49 UTC

[GitHub] [dolphinscheduler] devosend commented on a change in pull request #7783: [python] Task condition missing two downstream param

devosend commented on a change in pull request #7783:
URL: https://github.com/apache/dolphinscheduler/pull/7783#discussion_r778015716



##########
File path: dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/task.py
##########
@@ -156,7 +157,8 @@ def __init__(
         self.resource_list = resource_list or []
         self.dependence = dependence or {}
         self.wait_start_timeout = wait_start_timeout or {}
-        self.condition_result = condition_result or self.DEFAULT_CONDITION_RESULT
+        if task_type != TaskType.CONDITIONS:
+            self.condition_result = condition_result or self.DEFAULT_CONDITION_RESULT

Review comment:
       Maybe you can also define a function decorated with `@condition_result.setter ` in `Conditions` task.

##########
File path: dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/tasks/condition.py
##########
@@ -182,4 +201,5 @@ def task_params(self, camel_attr: bool = True, custom_attr: set = None) -> Dict:
         """
         params = super().task_params
         params["dependence"] = self.condition.get_define()
+        params["conditionResult"] = self.condition_result

Review comment:
       Is this line redundant? beause `condition_result ` defined in custom_attr of `Task.task_params`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org