zhongjiajie commented on code in PR #123:
URL: 
https://github.com/apache/dolphinscheduler-sdk-python/pull/123#discussion_r1435917023


##########
src/pydolphinscheduler/core/task.py:
##########
@@ -245,13 +245,22 @@ def workflow(self, workflow: Optional[Workflow]):
         """Set attribute workflow."""
         self._workflow = workflow
 
+    @staticmethod
+    def _parse_timeout(val: Any) -> Any:
+        if val is None or isinstance(val, timedelta):
+            return timedelta2timeout(val) if val else 0
+        elif val >= 0:
+            return val
+        else:
+            raise PyDSParamException("The timeout value cannot be negative")

Review Comment:
   Maybe we can embed this logic into function `timeout`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to