Skip to content

Commit

Permalink
fix(typing): StreamFunc type to match the udf signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosschroh committed Dec 6, 2023
1 parent ee1756c commit 07347a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions kstreams/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@

logger = logging.getLogger(__name__)

# Function required by the `stream` decorator
StreamFunc = Callable[..., Awaitable[Any]]


class Stream:
"""
Expand Down Expand Up @@ -86,7 +89,7 @@ def __init__(
self,
topics: Union[List[str], str],
*,
func: Callable[..., Awaitable[Any]],
func: StreamFunc,
backend: Optional[Kafka] = None,
consumer_class: Type[ConsumerType] = Consumer,
name: Optional[str] = None,
Expand Down Expand Up @@ -272,10 +275,6 @@ async def __anext__(self) -> ConsumerRecord:
raise StopAsyncIteration # noqa: F821


# Function required by the `stream` decorator
StreamFunc = Callable[[Stream], Awaitable[Any]]


def stream(
topics: Union[List[str], str],
*,
Expand Down

0 comments on commit 07347a7

Please sign in to comment.