Skip to content

fix: #90 #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion taskiq_faststream/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def dumps( # type: ignore[override]
:param message: message to send.
:return: Dumped message.
"""
labels = message.labels
labels = message.labels.copy()
labels.pop("schedule", None)
labels.pop("schedule_id", None)

Expand Down
8 changes: 8 additions & 0 deletions taskiq_faststream/kicker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
from typing import Any

from taskiq.kicker import AsyncKicker, _FuncParams, _ReturnType
from taskiq.message import TaskiqMessage


class LabelRespectKicker(AsyncKicker[_FuncParams, _ReturnType]):
"""Patched kicker doesn't cast labels to str."""

def _prepare_message(self, *args: Any, **kwargs: Any) -> TaskiqMessage:
msg = super()._prepare_message(*args, **kwargs)
msg.labels = self.labels
return msg