xinbinhuang commented on a change in pull request #7249: [AIRFLOW-6626] Add
email on failure or retry to default config
URL: https://github.com/apache/airflow/pull/7249#discussion_r370529894
##########
File path: airflow/models/baseoperator.py
##########
@@ -299,8 +299,8 @@ def __init__(
task_id: str,
owner: str = conf.get('operators', 'DEFAULT_OWNER'),
email: Optional[Union[str, Iterable[str]]] = None,
- email_on_retry: bool = True,
- email_on_failure: bool = True,
+ email_on_retry: bool = conf.getboolean('email',
'default_email_on_retry'),
Review comment:
The main reason for proposing this change is that I believe not every team
uses emails to alert on job failure (our team only use slack alert). So every
time we create a dag, we need to remember to set these 2 options to `False`,
which is error-prone sometimes. Once we does forget to set to False and pass
the code review, the error log would be messed with email related error when a
task fail. I guess I can also have some some safe guard in CI/CD, but it will
be nice if we can override the default setting globally.
I am not sure what problem would it cause if we set it globally. Can you
explain a bit about your concern?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services