From c03a9e8a7661a5cab1d6beb92615f052cd0b8e35 Mon Sep 17 00:00:00 2001 From: Quentin Date: Mon, 6 Jan 2025 15:59:29 +0100 Subject: [PATCH] mypy: ensure default are set in overloaded methods (#698) --- quixstreams/core/stream/stream.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/quixstreams/core/stream/stream.py b/quixstreams/core/stream/stream.py index 947fac6ad..0b069cfc3 100644 --- a/quixstreams/core/stream/stream.py +++ b/quixstreams/core/stream/stream.py @@ -113,7 +113,7 @@ def __repr__(self) -> str: return f"<{self.__class__.__name__} [{len(tree_funcs)}]: {funcs_repr}>" @overload - def add_filter(self, func: FilterCallback, *, metadata: Literal[False]): + def add_filter(self, func: FilterCallback, *, metadata: Literal[False] = False): pass @overload @@ -149,7 +149,11 @@ def add_filter( @overload def add_apply( - self, func: ApplyCallback, *, expand: Literal[False], metadata: Literal[False] + self, + func: ApplyCallback, + *, + expand: Literal[False] = False, + metadata: Literal[False] = False, ): pass @@ -159,7 +163,7 @@ def add_apply( func: ApplyExpandedCallback, *, expand: Literal[True], - metadata: Literal[False], + metadata: Literal[False] = False, ): pass @@ -168,7 +172,7 @@ def add_apply( self, func: ApplyWithMetadataCallback, *, - expand: Literal[False], + expand: Literal[False] = False, metadata: Literal[True], ): pass @@ -217,7 +221,7 @@ def add_apply( return self._add(apply_func) @overload - def add_update(self, func: UpdateCallback, *, metadata: Literal[False]): + def add_update(self, func: UpdateCallback, *, metadata: Literal[False] = False): pass @overload @@ -251,7 +255,7 @@ def add_update( return self._add(update_func) @overload - def add_transform(self, func: TransformCallback, *, expand: Literal[False]): + def add_transform(self, func: TransformCallback, *, expand: Literal[False] = False): pass @overload