Skip to content

Conversation

@Kiretori
Copy link
Contributor

@Kiretori Kiretori commented Aug 19, 2025

Closes: #53135

Added an existence check for mark_success_url in the default SMTP html template.
The TaskInstance class properly defines a mark_success_url property, while the RuntimeTaskInstance class used during task execution does not. This results in an UndefinedError when the email template tries to access ti.mark_success_url on a RuntimeTaskInstance object.

This change makes sure:

  • The link is displayed when using TaskInstance objects (which have the property)
  • No error occurs when using RuntimeTaskInstance objects (which don't have the property)

@boring-cyborg
Copy link

boring-cyborg bot commented Aug 19, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@potiuk
Copy link
Member

potiuk commented Aug 21, 2025

Would it be possible to add a unit test ?

@Kiretori
Copy link
Contributor Author

Kiretori commented Aug 21, 2025

Would it be possible to add a unit test ?

I don't think that's necessary for this change. I just added some guard rails with an existence check, if there are already some unit tests for the SmtpNotifier they should still pass. If a unit test is mandatory for this PR to get merged I could look into that.

@potiuk
Copy link
Member

potiuk commented Aug 22, 2025

Would it be possible to add a unit test ?

I don't think that's necessary for this change. I just added some guard rails with an existence check, if there are already some unit tests for the SmtpNotifier they should still pass. If a unit test is mandatory for this PR to get merged I could look into that.

Na.. It's ok . Templating is not as crucial to be tested.

@Kiretori
Copy link
Contributor Author

Would it be possible to add a unit test ?

I don't think that's necessary for this change. I just added some guard rails with an existence check, if there are already some unit tests for the SmtpNotifier they should still pass. If a unit test is mandatory for this PR to get merged I could look into that.

Na.. It's ok . Templating is not as crucial to be tested.

Okay, I guess it's ready to be merged now.

@potiuk potiuk merged commit 94b443f into apache:main Aug 22, 2025
57 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 22, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@Kiretori Kiretori deleted the fix-email-template-mark-success-url branch August 22, 2025 15:23
mangal-vairalkar pushed a commit to mangal-vairalkar/airflow that referenced this pull request Aug 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RuntimeTaskInstance object' has no attribute 'mark_success_url'

3 participants