Repository navigation
[v3-4-test] Deprecate airflow.utils.email in favor of the SMTP provider (#75414) - #75709
Merged
Merged
Conversation
1 task done
vatsrahul1001
marked this pull request as ready for review
October 27, 2026 04:40
vatsrahul1001
enabled auto-merge (squash)
October 27, 2026 04:40
…er (#75414) * Deprecate airflow.utils.email in favor of the SMTP provider The email utilities now live in airflow.providers.smtp.utils.emailer. airflow.utils.email keeps its public names as deprecated aliases of the provider functions, so existing imports and email_backend settings keep working with a DeprecatedImportWarning. The default [email] email_backend value is unchanged. The Task SDK treats it as "no custom backend" and sends alerts with SmtpNotifier, as before. A regression test covers email sent from a server process, such as a listener in the API server, with the SMTP login stored only in the metadata database. airflow-core now requires apache-airflow-providers-smtp>=3.2.0, the first release that contains the emailer module. * Keep star imports of airflow.utils.email working and document the move "from airflow.utils.email import *" imported the email functions before they moved to the SMTP provider. Listing them in __all__ keeps that import working, with the same deprecation warning as named imports. The email configuration guide now says where the functions live, that the default email_backend value is unchanged, and that the moved functions do not see settings changed at runtime with airflow.configuration.conf.set(). The coverage script entry for airflow/utils/email.py is left unchanged, so this change stays within airflow-core. * Shorten the core email page and point to the SMTP provider docs The SMTP server and connection setup is documented by the SMTP provider, so the core page now only explains email_backend and the [email] options shared by all backends, and links to the provider docs. * Explain what changes for callers of the deprecated email functions Add a significant newsfragment, keep email_backend at its default in the docs note, and name the Connection lookup and configuration source in the deprecation warning. * Test that a plain script does not see a database-only SMTP Connection Outside task and server processes the Connection lookup only searches environment variables and secrets backends, so the email is sent without a login. The newsfragment describes this; the test now covers it. (cherry picked from commit ad6ec79) Co-authored-by: Shivam Rastogi <6463385+shivaam@users.noreply.github.com>
vatsrahul1001
force-pushed
the
backport-ad6ec79-v3-4-test
branch
from
October 27, 2026 05:41
a1d25ad to
9bfcd24
Compare
airflow-core now requires providers-smtp>=3.2.0 (email deprecation, #75414/#75709). The emailer source landed via #75704 but the in-repo provider version was still 3.1.1, so the CI image build failed resolving the floor. Mirrors the smtp slice of the 3.2.0 provider release (#75209): version + provider.yaml + changelog + doc refs.
1 task
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 27, 2026
The backport of #75414 (#75709) raised the SMTP provider version in its pyproject.toml without refreshing uv.lock. The constraints jobs run `uv sync`, which then tries to rewrite the lock file. The lock is bind-mounted as a single file in the container, so the rename fails with "Device or resource busy" and every "Generate constraints" job on v3-4-test fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The email utilities now live in airflow.providers.smtp.utils.emailer.
airflow.utils.email keeps its public names as deprecated aliases of the
provider functions, so existing imports and email_backend settings keep
working with a DeprecatedImportWarning.
The default [email] email_backend value is unchanged. The Task SDK treats it
as "no custom backend" and sends alerts with SmtpNotifier, as before.
A regression test covers email sent from a server process, such as a
listener in the API server, with the SMTP login stored only in the metadata
database.
airflow-core now requires apache-airflow-providers-smtp>=3.2.0, the first
release that contains the emailer module.
"from airflow.utils.email import *" imported the email functions before
they moved to the SMTP provider. Listing them in all keeps that import
working, with the same deprecation warning as named imports.
The email configuration guide now says where the functions live, that the
default email_backend value is unchanged, and that the moved functions do
not see settings changed at runtime with airflow.configuration.conf.set().
The coverage script entry for airflow/utils/email.py is left unchanged, so
this change stays within airflow-core.
The SMTP server and connection setup is documented by the SMTP provider, so the core page now only explains email_backend and the [email] options shared by all backends, and links to the provider docs.
Add a significant newsfragment, keep email_backend at its default in the docs note, and name the Connection lookup and configuration source in the deprecation warning.
Outside task and server processes the Connection lookup only searches environment variables and secrets backends, so the email is sent without a login. The newsfragment describes this; the test now covers it.
(cherry picked from commit ad6ec79)
Co-authored-by: Shivam Rastogi 6463385+shivaam@users.noreply.github.com