English
Open in Telegram

Post 🚀 New issue to ag2ai/faststream by @Lancetnik

27 August 2026
G
gh-issuer-bot
🚀 New issue to ag2ai/faststream by @Lancetnik 📝 Bug: `redis.asyncio.Redis` type hint is not injected and fails validation (#3065) Describe the bug Annotating a handler argument with redis.asyncio.Redis — the obvious type for the connection — does not inject it. Instead the argument is treated as a message field and fails validation. The working annotation is faststream.redis.annotations.Redis, which is a different symbol with the same name. The two names are identical, the import paths differ, and nothing in the failure points at the fix. How to reproduce from redis.asyncio import Redis @broker.subscriber(stream=StreamSub("stream", group="group", consumer="consumer")) async def handler(msg: RedisStreamMessage, redis: Redis) -> None: ... vs. the version that works: from faststream.redis.annotations import Redis Real usage A worker running faststream[redis] in production hit this and left a warning to their future selves in the handler docstring — SW-Maestro-17th-HBB/Kkori-AI, worker/src/main.py#L186-L191: redis 는 FastStream 이 Context 로 넣어주는 커넥션이다. redis.asyncio.Redis 를 그대로 힌트로 쓰면 주입되지 않고 검증 오류가 난다. ("redis is the connection FastStream injects via Context. If you use redis.asyncio.Redis directly as the hint, it is not injected and you get a validation error.") They also import it aliased — from faststream.redis.annotations import Redis as InjectedRedis — which suggests the name collision cost them enough to want it visible at the call site. Expected behavior Two things would each be enough on their own: 1. Documentation — the Redis pages show Redis in examples without making the import path explicit enough to survive a copy-paste. A short note that the annotation comes from faststream.redis.annotations, and that the same-named driver class will not work, closes it. 2. A better failure — when an argument is annotated with a broker client class that has a matching FastStream annotation, say so in the error instead of failing validation on a missing message field. Additional context Found by reading a real user's source, not reported by them — they worked around it and moved on, which is the reason this kind of papercut stays invisible. Companion finding: #3064. @IvanKirpichnikov — the docs half is cheap; the error-message half is your call. #bug #documentation #good_first_issue #redis #faststream #ag2ai sent via relator
2 · 382 ·

Nearby in the feed

Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Add `Parser.validate` method to perform import-time checks (#1304) While working on #1275, I reGgh-issuer-bot🚀 New issue to ag2ai/faststream by @mahdialibi 📝 DOC - V 0.5 - Error in documentaion (#3047) in documentation : https://faststream.ag2.ai/0.5/getting-started/ob
this message
Ggh-issuer-bot🚀 New issue to faststream-community/zMQTT by @borisalekseev 📝 MQTT 5 publish() silently succeeds when PUBACK or PUBREC rejects the message (#65) Summary MQTTCliWwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Implement "Breaking changes" detector (#912) Since we have a pretty good OpenAPI scheme, it all
ННаходки в опенсорсе: PythonНаходки в опенсорсе: Python@opensource_findings_python · channel · Tech
1 052subscribers322average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count