Read HITLOperator subject/body into the summary lazily#70345
Merged
Conversation
1fanwang
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
July 23, 2026 23:17
subject and body are template fields, rendered after __init__ runs. The constructor built hitl_summary with self.subject/self.body, so a templated subject or body was captured as its un-rendered Jinja expression -- and the OpenLineage task START event, which reads hitl_summary, emitted the raw template instead of the rendered value. Make hitl_summary a property so subject/body are read at access time, after rendering. Runtime and subclass additions go through a private _hitl_summary_extra dict that the property merges in. related: apache#70296 Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
marked this pull request as draft
July 24, 2026 05:47
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Lee-W
approved these changes
Jul 24, 2026
shahar1
added a commit
to shahar1/airflow
that referenced
this pull request
Jul 24, 2026
apache#70345 turned hitl_summary into a computed property and moved runtime and subclass additions into a private _hitl_summary_extra dict. That left HITLOperator subclasses without a supported way to extend the summary (the pattern the old attribute explicitly documented) and leaks the private attribute name into OpenLineage include_full_task_info events. The property change has not shipped in a provider release yet, so renaming the dict to a public hitl_summary_extra establishes the replacement contract while it is still free of any compatibility cost.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
subjectandbodyare template fields, rendered after__init__runs.hitl_summarywas built in the constructor fromself.subject/self.body, so it captured the un-rendered Jinja. OpenLineage readshitl_summarywhen it builds the task START event, so a templatedsubject/bodywas emitted as raw{{ ... }}instead of the resolved value.Make
hitl_summarya property that readssubject/bodyat access time — after rendering — so listeners and the OpenLineage START event see the resolved values. Runtime and subclass additions (timeout_datetime,approved,branches_to_execute, …) go through a private_hitl_summary_extradict that the property merges in; the summary keys are otherwise unchanged.related: #70296
Testing Done
New
test_summary_reflects_rendered_subject_bodyrenders a templatedsubject/bodyand asserts the summary exposes the resolved values. RED on the pre-fix source, GREEN after the property:The
example_openlineage_hitl_dagsystem DAG (all four HITL variants) drives the START/COMPLETE events end-to-end in CI and checks each event'shitl_summarycarries the renderedsubject.validate_operators_init.pyon the operator exits 0.Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines