rjgoyln opened a new pull request, #73221:
URL: https://github.com/apache/airflow/pull/73221
## Summary
The default task failure email renders `{{ ti }}` in its subject. On Airflow
2 that gave the `TaskInstance` repr; the worker-side task instance is now a
Pydantic model with no textual form of its own, so the subject is its entire
field dump and no longer says which task failed:
```
Airflow alert: id=UUID('019c3eb1-…') task_id='fail'
dag_id='test-email-on-failure'
run_id='manual__2026-02-08T19:18:47.078356+00:00' try_number=1
dag_version_id=UUID('019c3ea3-…') map_index=-1 hostname='…' context_carrier={}
task=<Task(_PythonDecoratedOperator): fail>
bundle_instance=GitHubAppDagBundle(name=github-app) …
```
`__str__` rather than `__repr__`, so templates and `%s` log lines read
cleanly while a debugger or a failed assertion still shows every field.
## Scope
Only the subject; redesigning the message body is #67931.
The change is in `task-sdk` rather than `providers/smtp` because
`_send_error_email_notification` passes an explicit subject, so the bundled
notifier templates — which already name the Dag and task — never apply on this
path.
## Behavior change
The Dag-processor callback path builds the task instance without a state, so
its subject reads `[None]` there.
related: #61667
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 5)
Generated-by: Claude Code (Opus 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]