Skip to content

Fix/473 process item missing spider arg#474

Open
iayanpahwa wants to merge 3 commits intoscrapinghub:masterfrom
iayanpahwa:fix/473-process-item-missing-spider-arg
Open

Fix/473 process item missing spider arg#474
iayanpahwa wants to merge 3 commits intoscrapinghub:masterfrom
iayanpahwa:fix/473-process-item-missing-spider-arg

Conversation

@iayanpahwa
Copy link
Copy Markdown

Summary

  • Rename _ to spider=None in process_item() so Scrapy 2.14+ correctly detects the parameter and the method works with or without the spider argument
  • Add regression test calling process_item() without spider argument

Fixes #473

Scrapy 2.14+ inspects process_item() parameter names to decide
whether to pass the spider argument. Rename _ to spider=None so
it works with both old and new Scrapy versions. (scrapinghub#473)
Verifies that ItemValidationPipeline.process_item() works when
called without the spider argument, as Scrapy 2.14+ does. (scrapinghub#473)
@iayanpahwa iayanpahwa force-pushed the fix/473-process-item-missing-spider-arg branch from 76ea943 to d458b77 Compare April 2, 2026 16:01
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.95%. Comparing base (79b44cc) to head (d458b77).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #474   +/-   ##
=======================================
  Coverage   79.95%   79.95%           
=======================================
  Files          77       77           
  Lines        3287     3287           
  Branches      323      323           
=======================================
  Hits         2628     2628           
  Misses        591      591           
  Partials       68       68           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ItemValidationPipeline breaks with Scrapy 2.14+ (process_item() missing required argument)

1 participant