Skip to content

Provide Request instance in on_skipped_request callback #2007

Description

@vdusek

SkippedRequestCallback receives only the URL string, so handlers can't access request metadata (notably user_data) for skipped requests:

SkippedRequestCallback = Callable[[str, SkippedReason], Awaitable[None]]

#1999 implements passing the Request in a backward-compatible way, but that requires dual-dispatching on the callback's parameter type annotation, which is fragile runtime inspection (see this comment). Since v2 allows breaking changes, do it there with a clean signature instead:

SkippedRequestCallback = Callable[[Request, SkippedReason], Awaitable[None]]

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions