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_r371029259
##########
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:
Hi @kaxil, I updated the code based on your feedback.
1. Add `fallback=True` to both email_on_retry and email_on_failure
2. Add a check in the pre-commit config which will fail when it's not
`conf.getboolean` (this is my first time to write something about pre-commit
using pygrep. Let me if it needs to be modified.
Also,
- I added a similar check to the `retreis` argument i.e. fail when it's not
`conf.getint`
- Resort the pre-commit check order: now all checks with id: `base-operator`
goes together.
PTAL. Thanks!
----------------------------------------------------------------
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