Validate ProduceToTopicOperator topic after rendering - #70333
Merged
Conversation
topic is a template field, so it is rendered after __init__ runs. The presence check (if not (self.topic and self.producer_function)) ran in the constructor, where a templated topic is still the un-rendered Jinja expression. A topic that renders to empty therefore slipped past the guard and execute() tried to produce to it. Move the check to the start of execute(), which runs after rendering. related: apache#70296 Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
July 23, 2026 21:23
1fanwang
marked this pull request as draft
July 24, 2026 05:47
Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
marked this pull request as ready for review
July 24, 2026 06:23
shahar1
approved these changes
Jul 24, 2026
Contributor
|
Failed tests seem unrelated |
1 task
shahar1
approved these changes
Jul 24, 2026
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Drop exemption entries that sibling burn-down PRs already resolved on main. Net change to this file is only the ProduceToTopicOperator removal. Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com> # Conflicts: # scripts/ci/prek/validate_operators_init_exemptions.txt
7 tasks
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.
topicis a template field, so it is rendered after__init__runs. The presence checkif not (self.topic and self.producer_function)ran in the constructor, where a templatedtopicis still the un-rendered Jinja expression (always truthy). Atopicthat renders to empty therefore slipped past the guard, andexecute()tried to produce to it. Move the check to the start ofexecute(), which runs after rendering.related: #70296
Testing Done
Operator-level repro (real Dag, real render, real
execute): a templatedtopicrendering to""reaches the producer on the pre-fix code (message delivery is attempted and times out) instead of being rejected. After the fix,execute()raises up front:The new
test_execute_rejects_empty_rendered_topicdrives that render→execute path; it fails on the pre-fix source and passes after.test_produce.py: 3 passed.Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines