feat: provide Request instances in skipped request callbacks#1999
Open
vdusek wants to merge 4 commits into
Open
feat: provide Request instances in skipped request callbacks#1999vdusek wants to merge 4 commits into
vdusek wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1999 +/- ##
==========================================
+ Coverage 93.09% 93.17% +0.08%
==========================================
Files 167 167
Lines 11775 11815 +40
==========================================
+ Hits 10962 11009 +47
+ Misses 813 806 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ts skips out of transform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
on_skipped_requestcallbacks can now receive the fullRequestobject instead of only the URL string, so handlers can access request metadata such asuser_data.This stays backward compatible by dual-dispatching on the type annotation of the callback's first parameter: annotate it as
Requestto receive the object, while astrannotation (or no annotation) keeps receiving the URL string as before. Skipped URLs are normalized toRequestonce at the choke points (add_requestsand bothextract_linksimplementations), the duplicated request-building helper was extracted tocrawlee._utils.requests.create_request_from_options, and link extraction now appliestransform_request_functionto robots-skipped requests for consistency with enqueued ones.Reworked from #1927 (original author inactive).