If a label with a type different from str is added anywhere in the worker task, the task will fail.
@broker.task
async def generation_task(params: RequestParams, context: Annotated[Context, TaskiqDepends()]):
result = do_some_work(params)
context.message.labels['non_str_field'] = 42
return result
I suspect the issue lies in the construction of the TaskiqResult object at /taskiq/receiver/receiver.py:294.
While it's acceptable for the task to fail on unknown types, the problem is that it doesn't display anything in the log. This lack of information made it necessary for me to spend extra time figuring out what went wrong.
Perhaps, to make this workaround clearer, we could consider adding some logging?
If a label with a type different from
str
is added anywhere in the worker task, the task will fail.I suspect the issue lies in the construction of the
TaskiqResult
object at/taskiq/receiver/receiver.py:294
.While it's acceptable for the task to fail on unknown types, the problem is that it doesn't display anything in the log. This lack of information made it necessary for me to spend extra time figuring out what went wrong.
Perhaps, to make this workaround clearer, we could consider adding some logging?