malthe commented on a change in pull request #18112:
URL: https://github.com/apache/airflow/pull/18112#discussion_r705622219



##########
File path: airflow/exceptions.py
##########
@@ -256,12 +278,21 @@ def __init__(
         self.method_name = method_name
         self.kwargs = kwargs
         self.timeout = timeout
+
         # Check timeout type at runtime
         if self.timeout is not None and not hasattr(self.timeout, 
"total_seconds"):
             raise ValueError("Timeout value must be a timedelta")
 
+        # Check keyword arguments
+        if kwargs:
+            if method_name is None:
+                raise ValueError("Keyword arguments not allowed when method is 
not specified")

Review comment:
       On not allowing `kwargs` when `method_name` is unset, I just thought it 
was a little cleaner. I'm not sure I understand the part about custom kwargs 
for `execute` – how does that look/work?
   
   Is this an anti-pattern? So I don't think so and there is some more 
discussion on this in #17576. For example, if I want to postpone a particular 
task (not the whole DAG, just a task) so that it runs no earlier than 7:30am 
then to me, that is a scheduling policy on the task, it's not helpful to have 
another "delayer" task in front of it because ultimately, that just contributes 
to noise.
   
   I'm migrating some workflows from a different system where there is 
task-level scheduling that allows such configurations and it really works quite 
well. There is less clutter when each task has a little bit more "scheduling 
power". But of course, that's just a point of view.




-- 
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