Skip to content

Fix SDK to read default_email_on_failure and default_email_on_retry from config#59912

Merged
potiuk merged 3 commits intoapache:mainfrom
justinpakzad:fix/email-on-failure-static-default
Dec 31, 2025
Merged

Fix SDK to read default_email_on_failure and default_email_on_retry from config#59912
potiuk merged 3 commits intoapache:mainfrom
justinpakzad:fix/email-on-failure-static-default

Conversation

@justinpakzad
Copy link
Contributor

@justinpakzad justinpakzad commented Dec 29, 2025

closes: #59380

The SDK is not reading the config values for default_email_on_failure/default_email_on_retry and they are hardcoded as True. I updated the default values to fetch from the config.

If the config is intentionally no longer used (due to deprecation of these params) then I can mark it as deprecated in the configuration reference and config template, with a note directing users to set email_on_failure explicitly in default_args instead.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I wonder if this is really intended. It looks like it should be. Also it would be great to get some tests covering it ?

@justinpakzad
Copy link
Contributor Author

LGTM, but I wonder if this is really intended. It looks like it should be. Also it would be great to get some tests covering it ?

So there are already two tests in the tests/task_sdk/bases/test_operator.py file that cover the defaults and setting email_on_retry to False. I assumed that should be sufficient but happy to add more if needed.

@potiuk potiuk merged commit 217d6f3 into apache:main Dec 31, 2025
99 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 31, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Jan 2, 2026
…rom config (apache#59912)

* Added variable to fetch email on retry/failure values from conf

* prek formatting

* prek formatting
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
…rom config (apache#59912)

* Added variable to fetch email on retry/failure values from conf

* prek formatting

* prek formatting
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
…rom config (apache#59912)

* Added variable to fetch email on retry/failure values from conf

* prek formatting

* prek formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Airflow 3.x] AIRFLOW__EMAIL__DEFAULT_EMAIL_ON_FAILURE config exists but is not read by SDK

3 participants

Comments