Make the HITLOperator summary extension point public - #70391
Conversation
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.
potiuk
left a comment
There was a problem hiding this comment.
Agreed with the concern that prompted this. Once hitl_summary became a property, each access builds a fresh dict, so the documented "subclasses can extend it" pattern silently stopped working — anything written to the returned dict lands in a throwaway snapshot. Leaving the only working route behind a private name wasn't a real extension point.
The docstring addition is the part I value most here: writing down that the snapshot is rebuilt per access is what stops the next person rediscovering this the hard way.
Checked that the rename is complete — all ten internal sites, and nothing outside hitl.py referenced the private name. No compat exposure either, since _hitl_summary_extra was private and hasn't appeared in a released changelog entry.
One thought for later, not for this PR: a public mutable dict means subclasses have to call super().__init__() before touching it or they get an AttributeError. Both current subclasses do. An overridable hook would be order-independent, but the dict matches how the internals already use it and is the smaller change.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
related: #70345
Human Summary
I had some concerns regarding
_hitl_summary_extrabeing a private dictionary after I merged the above.As the docs state that subclasses can extend HITLOperator, it should function better as a public attribute.
AI Summary
#70345 turned
hitl_summaryinto a computed property (so templatedsubject/bodyare read after rendering) and moved runtime/subclass additions into a private_hitl_summary_extradict. That leftHITLOperatorsubclasses without a supported way to extend the summary — the pattern the old attribute explicitly documented ("subclasses can extend it") now silently mutates a throwaway snapshot — and it leaks the private attribute name into OpenLineageinclude_full_task_infoevents (which serialize the operator's__dict__, where a property never appears).This renames the dict to a public
hitl_summary_extraand documents the contract on the property: each access builds a fresh snapshot, mutation of the returned dict has no effect, and extensions go throughhitl_summary_extra. Since #70345 has not shipped in a provider release yet, the rename is free of compatibility cost — waiting until after the next provider wave would turn it into a real break.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines