apache/airflow

emailoperator with connection, missing config variable support (from_email), prefering airflow.cfg variable

Open

#31,211 创建于 2023年5月11日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Python (16,781 fork)batch import
area:coregood first issuekind:feature

仓库指标

Star
 (44,809 star)
PR 合并指标
 (平均合并 7天 18小时) (30 天内合并 834 个 PR)

描述

Apache Airflow version

2.6.0

What happened

the email operator when used with a connection is hard coded to use the smtp/smtp_mail_from and email/from_email variables from the airflow configuration. this should be adjusted to check if the connection has these vars set and prefer those instead.

there is a warning about configuration of email from airflow configuration being unsupported soon, so these config vars need to be supported in connections

What you think should happen instead

if smtp_mail_from and from_email are set in extra_vars on a connection it should prefer those

How to reproduce

setup airflow.cfg with incorrect smtp/smtp_mail_from and email/from_email variables. attempt to override these with variables on an email connection use the emailoperator with the new connection to send an email see that the email was sent with the variables set in airflow.cfg

Operating System

Debian GNU/Linux 11 (bullseye)

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

bitnami containers on baremetal debian with docker-compose

Anything else

lines which need to be adjusted to support connection based vars:

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

贡献者指南