Fix AwaitMessageTrigger missing _task_instance attribute#66302
Merged
potiuk merged 2 commits intoMay 10, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the Kafka provider’s AwaitMessageTrigger where BaseTrigger initialization was skipped, leaving _task_instance unset and causing AttributeError during triggerer cleanup.
Changes:
- Call
super().__init__()inAwaitMessageTrigger.__init__()so base trigger state (including_task_instance) is always initialized. - Add a unit test that verifies
_task_instance/task_instanceexist and start asNoneimmediately after constructing the trigger.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
providers/apache/kafka/src/airflow/providers/apache/kafka/triggers/await_message.py |
Ensures base trigger initialization runs by calling super().__init__() in the trigger constructor. |
providers/apache/kafka/tests/unit/apache/kafka/triggers/test_await_message.py |
Adds a regression test to confirm base trigger state is initialized on construction. |
810f895 to
7d07b5e
Compare
7d07b5e to
a6237e2
Compare
potiuk
approved these changes
May 10, 2026
1 task
jason810496
added a commit
to jason810496/airflow
that referenced
this pull request
May 11, 2026
* Fix AwaitMessageTrigger missing _task_instance attribute * CI: Fix compat test
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.
trigger._task_instance)Why
While working on adding E2E test for event driving Dag with Kafka in #64833, I encounter the following error:
The root cause is:
AwaitMessageTrigger.__init__never callssuper().__init__(), so_task_instanceis never set. The triggerer crashes on cleanup withAttributeError: 'AwaitMessageTrigger' object has no attribute '_task_instance', and dependent tasks fail.What
super().__init__()inAwaitMessageTrigger.__init__._task_instance/task_instanceare initialized after construction.Was generative AI tooling used to co-author this PR?