Skip to content

Commit

Permalink
Fixing CallbackResultType usage in minet.executors
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Apr 15, 2024
1 parent f9722c4 commit 67f6350
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions minet/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class HTTPWorkerPayload(HTTPWorkerPayloadBase[ItemType]):
ArgsCallbackType = Callable[[HTTPWorkerPayload[ItemType]], Dict]


class ExecutorRequestKwargs(TypedDict, Generic[ItemType, CallbackResultType]):
class ExecutorRequestKwargs(TypedDict, Generic[ItemType]):
ordered: NotRequired[bool]
key: NotRequired[Optional[Callable[[ItemType], Optional[str]]]]
throttle: NotRequired[float]
Expand All @@ -109,7 +109,7 @@ class ExecutorRequestKwargs(TypedDict, Generic[ItemType, CallbackResultType]):
known_encoding: NotRequired[Optional[str]]


class ExecutorResolveKwargs(TypedDict, Generic[ItemType, CallbackResultType]):
class ExecutorResolveKwargs(TypedDict, Generic[ItemType]):
ordered: NotRequired[bool]
key: NotRequired[Optional[Callable[[ItemType], Optional[str]]]]
throttle: NotRequired[float]
Expand Down Expand Up @@ -545,7 +545,7 @@ def request(
*,
passthrough: Literal[False] = ...,
callback: None = ...,
**kwargs: Unpack[ExecutorRequestKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorRequestKwargs[ItemType]],
) -> Iterator[AnyActualRequestResult[ItemType]]: ...

@overload
Expand All @@ -555,7 +555,7 @@ def request(
*,
passthrough: Literal[True] = ...,
callback: None = ...,
**kwargs: Unpack[ExecutorRequestKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorRequestKwargs[ItemType]],
) -> Iterator[AnyRequestResult[ItemType]]: ...

@overload
Expand All @@ -564,8 +564,8 @@ def request(
iterator: Iterable[ItemType],
*,
passthrough: Literal[False] = ...,
callback: Callable[[ItemType, str, Response], CallbackResultType] = ...,
**kwargs: Unpack[ExecutorRequestKwargs[ItemType, CallbackResultType]],
callback: Callable[[ItemType, str, Response], CallbackResultType],
**kwargs: Unpack[ExecutorRequestKwargs[ItemType]],
) -> Iterator[Tuple[AnyActualRequestResult[ItemType], CallbackResultType]]: ...

@overload
Expand All @@ -574,8 +574,8 @@ def request(
iterator: Iterable[ItemType],
*,
passthrough: Literal[True] = ...,
callback: Callable[[ItemType, str, Response], CallbackResultType] = ...,
**kwargs: Unpack[ExecutorRequestKwargs[ItemType, CallbackResultType]],
callback: Callable[[ItemType, str, Response], CallbackResultType],
**kwargs: Unpack[ExecutorRequestKwargs[ItemType]],
) -> Iterator[Tuple[AnyRequestResult[ItemType], CallbackResultType]]: ...

def request(
Expand Down Expand Up @@ -642,7 +642,7 @@ def resolve(
*,
callback: None = ...,
passthrough: Literal[False] = ...,
**kwargs: Unpack[ExecutorResolveKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorResolveKwargs[ItemType]],
) -> Iterator[AnyActualResolveResult[ItemType]]: ...

@overload
Expand All @@ -652,7 +652,7 @@ def resolve(
*,
callback: None = ...,
passthrough: Literal[True] = ...,
**kwargs: Unpack[ExecutorResolveKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorResolveKwargs[ItemType]],
) -> Iterator[AnyResolveResult[ItemType]]: ...

@overload
Expand All @@ -662,7 +662,7 @@ def resolve(
*,
callback: Callable[[ItemType, str, RedirectionStack], CallbackResultType],
passthrough: Literal[False] = ...,
**kwargs: Unpack[ExecutorResolveKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorResolveKwargs[ItemType]],
) -> Iterator[Tuple[AnyActualResolveResult[ItemType], CallbackResultType]]: ...

@overload
Expand All @@ -672,7 +672,7 @@ def resolve(
*,
callback: Callable[[ItemType, str, RedirectionStack], CallbackResultType],
passthrough: Literal[True] = ...,
**kwargs: Unpack[ExecutorResolveKwargs[ItemType, CallbackResultType]],
**kwargs: Unpack[ExecutorResolveKwargs[ItemType]],
) -> Iterator[Tuple[AnyResolveResult[ItemType], CallbackResultType]]: ...

def resolve(
Expand Down

0 comments on commit 67f6350

Please sign in to comment.