Skip to content

Remove deprecated spider argument from StatsCollector.inc_value() calls#309

Merged
rmax merged 2 commits into
masterfrom
copilot/fix-scrapy-deprecation-warning
Apr 8, 2026
Merged

Remove deprecated spider argument from StatsCollector.inc_value() calls#309
rmax merged 2 commits into
masterfrom
copilot/fix-scrapy-deprecation-warning

Conversation

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Scrapy deprecated passing a spider argument to StatsCollector.inc_value() and will remove it in a future version, causing ScrapyDeprecationWarning on every enqueue/dequeue operation.

Changes

  • scheduler.py: Drop spider=self.spider from both inc_value calls:
    # Before
    self.stats.inc_value("scheduler/enqueued/redis", spider=self.spider)
    self.stats.inc_value("scheduler/dequeued/redis", spider=self.spider)
    
    # After
    self.stats.inc_value("scheduler/enqueued/redis")
    self.stats.inc_value("scheduler/dequeued/redis")

Copilot AI changed the title [WIP] Fix ScrapyDeprecationWarning for StatsCollector.inc_value Remove deprecated spider argument from StatsCollector.inc_value() calls Apr 7, 2026
Copilot AI requested a review from rmax April 7, 2026 20:28
Copilot finished work on behalf of rmax April 7, 2026 20:28
@rmax rmax marked this pull request as ready for review April 7, 2026 21:37
Copilot AI review requested due to automatic review settings April 7, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes deprecated spider keyword usage in StatsCollector.inc_value() calls to avoid ScrapyDeprecationWarning during Redis scheduler enqueue/dequeue operations.

Changes:

  • Drop spider=self.spider from the scheduler/enqueued/redis stats increment.
  • Drop spider=self.spider from the scheduler/dequeued/redis stats increment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rmax rmax merged commit f90f76e into master Apr 8, 2026
10 of 12 checks passed
@rmax rmax deleted the copilot/fix-scrapy-deprecation-warning branch April 8, 2026 08:48
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.

ScrapyDeprecationWarning: Passing a 'spider' argument to StatsCollector.inc_value()

3 participants