-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add note to TriggerDagRunOperator #60407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note to TriggerDagRunOperator #60407
Conversation
| state=DagRunState.QUEUED, | ||
| session=session, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be
| if note: | |
| dag_run.note = note |
18bb27d to
44bd79a
Compare
44bd79a to
791fa6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? And verified that the triggered dagrun had the appropriate note?
After the exception is raised with the additional note field, we need to update the sdk code to have that handled. (mostly, supervisor.py).
That PR seems completely off (not tested, not double checked, not complying with our "contributing with AI" guidelines, closing feel free to re-open if I misunderstood something.
| if self.note: | ||
| dag_run = session.merge(dag_run) | ||
| dag_run.note = self.note | ||
| session.flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that on the _trigger_dag_af_2 ? TriggerDagRunOperator note will not be handled anyway, do we need that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, note information can be passed via UI and API, but TriggerDagRunOperator doesn't allow to pass note information. I put this part here in order to store the note information.
| # [START howto_operator_trigger_dagrun_with_note] | ||
| trigger_with_note = TriggerDagRunOperator( | ||
| task_id="trigger_with_note", | ||
| trigger_dag_id="example_trigger_target_dag", | ||
| note="Triggered with a note!", | ||
| ) | ||
| # [END howto_operator_trigger_dagrun_with_note] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example section probably need to be added to the corresponding doc file
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.