Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(
poll_interval: float = 5,
commit_offset: bool = True,
) -> None:
super().__init__()
self.topics = topics
self.apply_function = apply_function
self.apply_function_args = apply_function_args or ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@ async def test_cleanup_does_not_raise_without_consumer(self):

await trigger.cleanup()

def test_trigger_has_task_instance_attribute(self):
"""AwaitMessageTrigger must initialise _task_instance via super().__init__().

Without the super().__init__() call, accessing trigger.task_instance raises
AttributeError when used as an AssetWatcher trigger (where the triggerer never
sets the attribute via the task_instance setter).
"""
trigger = AwaitMessageTrigger(
kafka_config_id="kafka_d",
topics=["noop"],
)

assert hasattr(trigger, "_task_instance")
assert trigger.task_instance is None


@mark_common_msg_queue_test
class TestMessageQueueTrigger:
Expand Down
Loading