Skip to content

Commit fee9dda

Browse files
committed
fix: FastStream 0.5.0 compat
1 parent 482c8b5 commit fee9dda

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

taskiq_faststream/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""FastStream - taskiq integration to schedule FastStream tasks."""
2-
__version__ = "0.1.7"
2+
__version__ = "0.1.8"

taskiq_faststream/broker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import typing
22
import warnings
3+
from typing import Any
34

45
import anyio
56
from faststream.app import FastStream
6-
from faststream.broker.core.asynchronous import BrokerAsyncUsecase
77
from faststream.types import SendableMessage
88
from taskiq import AsyncBroker, BrokerMessage
99
from taskiq.acks import AckableMessage
@@ -31,7 +31,7 @@ class BrokerWrapper(AsyncBroker):
3131
task : Register FastStream scheduled task.
3232
"""
3333

34-
def __init__(self, broker: BrokerAsyncUsecase[typing.Any, typing.Any]) -> None:
34+
def __init__(self, broker: Any) -> None:
3535
super().__init__()
3636
self.serializer = PatchedSerializer()
3737
self.broker = broker
@@ -131,7 +131,7 @@ async def kick(self, message: BrokerMessage) -> None:
131131

132132

133133
async def _broker_publish(
134-
broker: BrokerAsyncUsecase[typing.Any, typing.Any],
134+
broker: Any,
135135
message: BrokerMessage,
136136
) -> None:
137137
labels = message.labels

tests/testcase.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from unittest.mock import MagicMock
55

66
import pytest
7-
from faststream.broker.core.asynchronous import BrokerAsyncUsecase
87
from faststream.utils.functions import timeout_scope
98
from taskiq import AsyncBroker, TaskiqScheduler
109
from taskiq.cli.scheduler.args import SchedulerArgs
@@ -20,14 +19,14 @@ class SchedulerTestcase:
2019
subj_name: str
2120

2221
@staticmethod
23-
def build_taskiq_broker(broker: BrokerAsyncUsecase[Any, Any]) -> AsyncBroker:
22+
def build_taskiq_broker(broker: Any) -> AsyncBroker:
2423
"""Build Taskiq compatible object."""
2524
return BrokerWrapper(broker)
2625

2726
async def test_task(
2827
self,
2928
subject: str,
30-
broker: BrokerAsyncUsecase[Any, Any],
29+
broker: Any,
3130
mock: MagicMock,
3231
event: asyncio.Event,
3332
) -> None:

0 commit comments

Comments
 (0)