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

fix(typing): StreamFunc type to match the udf signature. #142

Merged
merged 1 commit into from
Dec 6, 2023
Merged
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
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
Loading