Skip to content
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

Bufixes 745 #749

Merged
merged 15 commits into from
Sep 26, 2023
Merged
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 faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Simple and fast framework to create message brokers based microservices"""
__version__ = "0.1.3"
__version__ = "0.1.4"


INSTALL_YAML = """
Expand Down
2 changes: 1 addition & 1 deletion faststream/asyncapi/schema/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
JsonSchemaValue,
Required,
TypedDict,
with_info_plain_validator_function,
is_installed,
with_info_plain_validator_function,
)
from faststream.log import logger

Expand Down
4 changes: 2 additions & 2 deletions faststream/broker/fastapi/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ async def app(message: NativeMessage[Any]) -> SendableMessage:
"""
body = message.decoded_body
if first_arg is not None:
if not isinstance(body, dict): # pragma: no branch
fastapi_body: AnyDict = {first_arg: body}
if not isinstance(body, dict) and not isinstance(body, list):
fastapi_body: Any = {first_arg: body}
else:
fastapi_body = body

Expand Down
2 changes: 1 addition & 1 deletion faststream/kafka/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def subscriber( # type: ignore[override]

self._setup_log_context(topics)

key = "".join(topics)
key = Handler.get_routing_hash(topics, group_id)
builder = partial(
aiokafka.AIOKafkaConsumer,
key_deserializer=key_deserializer,
Expand Down
4 changes: 4 additions & 0 deletions faststream/kafka/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,7 @@ async def _consume(self) -> Never:
if connected is False:
connected = True
await self.consume(msg)

@staticmethod
def get_routing_hash(topics: Sequence[str], group_id: Optional[str] = None) -> str:
return "".join((*topics, group_id or ""))