luc-pimentel commented on issue #74063:
URL: https://github.com/apache/airflow/issues/74063#issuecomment-6660199914

   > 8\. So I think the first question to answer: Does it make sense to have 
python callbacks on a task defined in another language? Is this really 
something we want to support?
   >     I have to admit, that my first thought is "no", and if you want 
callbacks, those should be defined on the other language side too when you 
define the task handler.
   
   For a Python Dag with stub tasks, I think it would make sense. The task is 
still declared in the Python Dag, and its callbacks are set there like its 
retries, often once in `default_args` for every task. Only the body runs in the 
other language.
   
   If the answer is no, maybe the stub tasks should at least say so? Because 
today they accept the callbacks and just never run them nor raise any way to 
observe this behavior (no logs, nor warnings or anything).
   
   For comparison, `retry_policy` is already rejected on `@task.stub`. The Dag 
fails to parse with a `ValueError`, even when the policy comes from 
`default_args`, because the policy is Python code and nothing would run it. 
Callbacks are also Python code, but they are accepted. Unlike a retry policy, 
they have somewhere else to run, because the Dag processor already runs failure 
callbacks when a task is killed.


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