Skip to content

fix: do not parse return value of errored tasks - #692

Open
sinnercode228 wants to merge 1 commit into
taskiq-python:masterfrom
sinnercode228:fix/no-parse-warning-on-errored-result
Open

sinnercode228 wants to merge 1 commit into
taskiq-python:masterfrom
sinnercode228:fix/no-parse-warning-on-errored-result

Conversation

@sinnercode228

Copy link
Copy Markdown

When a task fails, the receiver stores a result with is_err=True and return_value=None. AsyncTaskiqTask.get_result still tried to validate that None against the task's return annotation, so every failed task with a non-optional return type logged a misleading "Cannot parse return type into ..." warning on the client side.

Skip the validation when the result is an error: there is no return value to parse, and the actual failure is already available in result.error.

Closes: #479

When a task fails, the receiver stores a result with `is_err=True` and
`return_value=None`. `AsyncTaskiqTask.get_result` still tried to validate
that `None` against the task's return annotation, so every failed task
with a non-optional return type logged a misleading
"Cannot parse return type into ..." warning on the client side.

Skip the validation when the result is an error: there is no return value
to parse, and the actual failure is already available in `result.error`.

Closes: taskiq-python#479
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.37%. Comparing base (a00e4b0) to head (9512562).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #692   +/-   ##
=======================================
  Coverage   85.37%   85.37%           
=======================================
  Files          68       68           
  Lines        2659     2659           
=======================================
  Hits         2270     2270           
  Misses        389      389           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Noisy "Cannot parse return type..." log warning on task error

1 participant