Add note to triggerdagrunoperator
Description
Added support for passing a note to TriggerDagRunOperator.
Use Case
Currently, notes can only be passed via the API.
This PR adds a note argument to TriggerDagRunOperator for easier usage.
Related Issue
Closes: #56543
^ 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.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.
convert it to draft as lots of conflicts need to be resolved
Also, please check if the note gets passed correctly into the TriggerDagRunRequest and stored as expected. Maybe a unit or functional test for that path?
You could also check if you can add this to the operator’s example DAGs (under example_dags/) to help users discover it more easily.
Hi everyone ,
I’ve completed all the requested updates for this PR. I’ve implemented the note parameter for TriggerDagRunOperator, added an example DAG, and resolved all merge conflicts. I also performed a local unit test to verify that the note value is being correctly passed, even though I wasn’t able to run the full Breeze test suite due to environment issues.
I’ve done my best to ensure the logic is solid and that everything builds cleanly. Most of the CI checks have passed successfully , but one job (Build CI image 3.10) failed with a permission error (Operation not permitted: 'source/bin/python'), which seems unrelated to my changes.
Could a maintainer please re-run that job or take a look when convenient?
Thank you for your patience and support throughout this process! 🙏
Hi everyone ,
I’ve completed all the requested updates for this PR. I’ve implemented the note parameter for TriggerDagRunOperator, added an example DAG, and resolved all merge conflicts. I also performed a local unit test to verify that the note value is being correctly passed, even though I wasn’t able to run the full Breeze test suite due to environment issues.
I’ve done my best to ensure the logic is solid and that everything builds cleanly. Most of the CI checks have passed successfully , but one job (Build CI image 3.10) failed with a permission error (Operation not permitted: 'source/bin/python'), which seems unrelated to my changes.
@Lohith625 , Can you please recheck and remove all changes from files that are unrelated to the current Issue you are working on? For instance, why do you have so many changes in files related to breeze?
I apologize for not cleaning up the unrelated files earlier. As a beginner, I initially misunderstood some parts of the process. I’ve now cleaned everything properly — only the 3 files related to my issue remain (the operator, its test, and the example DAG). Thank you for your patience and guidance throughout this process 🙏
I apologize for not cleaning up the unrelated files earlier. As a beginner, I initially misunderstood some parts of the process. I’ve now cleaned everything properly — only the 3 files related to my issue remain (the operator, its test, and the example DAG). Thank you for your patience and guidance throughout this process 🙏
Please note that both static checks and unit tests fail -
- regarding statick checks, please refer to breeze docs
- Regarding the tests, they fail because of using the
noteparam inDagRunTriggerException.
In addition to the above, I recommend to try asking for mentorship in #new-contributors channel on the Slack channel.
You have some problems with static checks in your PR - I assume would be helpful to install prek and re-format the code. Following this here: https://github.com/apache/airflow/blob/main/contributing-docs/03a_contributors_quick_start_beginners.rst
For the errors like "TypeError: DagRunTriggerException.init() got an unexpected keyword argument 'note'" you need to adjust the parameter for the constructor of the Exception class. The exception is in Airflow Core but the provider that wants to trigger is in standard provider. Note that the provider can be upgraded and used also in other Airflow core versions so if you adjust the Exception it will fail in backwards-compatability. I'd leave out the note from the Exception, I assume usually the note is not the cause of exception.
Looks like we still have many failures that need to be resolved before the next review round. Mark it as draft
Could you please rebase your branch?
Could you please rebase your branch?
Thanks for the suggestion!
I’ve rebased the branch onto the latest apache/main and updated the PR. All checks are now passing.
Thank you for the reviews and feedback on this PR.
I’ve cleaned up unrelated changes and addressed the review comments raised so far.
This update adds support for anoteparameter to TriggerDagRunOperator, logs the note at trigger time, maintains compatibility across supported Airflow versions, and updates an existing example DAG to demonstrate usage. Relevant unit tests have been updated accordingly.
Please let me know if there are any further changes or adjustments you’d like me to make.