ashb commented on code in PR #26027:
URL: https://github.com/apache/airflow/pull/26027#discussion_r965676289
##########
airflow/dag_processing/processor.py:
##########
@@ -549,6 +549,17 @@ def update_import_errors(session: Session, dagbag: DagBag)
-> None:
synchronize_session='fetch',
)
else:
+ emails: Set[str] = set(conf.get(section='email',
key='dag_import_failure_email_to').split())
+ if emails and conf.getboolean(
+ section='email', key='email_on_dag_import_failure',
fallback=True
+ ):
+ try:
+ email_content = f"""File {filename} has failed to
import due to:\n
+ <pre><code>{stacktrace}<code></pre>
Review Comment:
I'm not sure if the emails are plain text or html, though I assume plain
text. So this doesn't seem right.
##########
airflow/dag_processing/processor.py:
##########
@@ -549,6 +549,17 @@ def update_import_errors(session: Session, dagbag: DagBag)
-> None:
synchronize_session='fetch',
)
else:
+ emails: Set[str] = set(conf.get(section='email',
key='dag_import_failure_email_to').split())
+ if emails and conf.getboolean(
+ section='email', key='email_on_dag_import_failure',
fallback=True
+ ):
Review Comment:
```suggestion
emails: Set[str] = set(conf.get(section='email',
key='dag_import_failure_email_to', fallback='').split())
if emails:
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]