-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Replace send_email from utils in task SDK with its own #55769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ashb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we could replace this with the SMTP provider's SmtpNotifier in some way?
It seems odd to have two different ways of sending email.
We could fail at parse time if you set email_on_failure = True and the smtp provider can't be imported?
|
@ashb we could, but do we want to create a dependency between task sdk and smtp provider? I did this to avoid that |
|
I think there is a qausi-dep there already -- SMTP provider was core, and you can define the credentials in an SMTP connection inside Airflow, can't you? This doesn't need to be a hard (i.e. pyproject-level) dependency |
|
I've thought about it before, and changing |
|
I am really not sure where are we going with the email/smtp integration. |
|
Lets not port this over then. Instead lets "upgrade in place" the use of I'll leave @amoghrajesh do decide if this PR gets closed or re-purposed. |
|
Thanks for all your comment, let's repurpose the existing SMTP notifier to do the email sending portion for us |
|
Closing in favour of #57354 |
closes: #54712
Why?
Task SDK uses the ability to send emails but it imports it from airflow.utils. As part of client server separation, getting rid of these imports in task sdk. This PR moves the _send_email function from utils to the task runner module to consolidate email-related functionality where it's actually used.
Changes
^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.