🎉 New Pull Request to taskiq-python/taskiq by @juanmicl
✨ fix: align positional argument parsing with parameter positions (#667)
📊 +80/-39
🌿 juanmicl:fix/worker-arg-parse-alignment → master
Closes: #666
parse_params mapped positional arguments to annotations using a counter
that only advanced for annotated parameters, so any unannotated
positional parameter shifted every following argument onto the wrong
annotation (values silently coerced by the wrong type, annotated
parameters never validated).
This PR decouples the positional slot index from annotation presence:
• every POSITIONAL_ONLY / POSITIONAL_OR_KEYWORD parameter advances
the slot index, annotated or not;
• parsing only happens when the parameter actually has an annotation;
• *args annotations now coerce all remaining positional arguments
(previously only the first element was coerced);
• keyword-only parameters go straight to the kwargs branch.
Behavior for fully-annotated signatures is unchanged, all existing
test_params_parser.py cases pass as-is.
Validation: full suite passes (pytest -q, 313 tests), black, ruff
and mypy clean (mypy reports the same 2 pre-existing errors in
taskiq/serializers/ as on master).
sent via relator