Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix The annoyning Deprecation issue in _middlewares.py #234

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

ahmed-ellaban
Copy link
Contributor

@ahmed-ellaban ahmed-ellaban commented Dec 4, 2024

This pull request includes a change to the slot_request method in the scrapy_zyte_api/_middlewares.py file. The change involves modifying the way the slot key is obtained from the downloader.

  • scrapy_zyte_api/_middlewares.py: Changed the method call from downloader._get_slot_key(request, spider) to downloader.get_slot_key(request) to use the public method instead of a private one, and hide the warning log

Fixes #232

Fix The annoyning Deprecation issue
by just using get_slot_key instead of _get_slot_key and remove the second param
You are 100% right

Co-authored-by: Adrián Chaves <[email protected]>
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.89%. Comparing base (5fbf0bc) to head (bacc5ed).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #234   +/-   ##
=======================================
  Coverage   97.89%   97.89%           
=======================================
  Files          14       14           
  Lines        1615     1618    +3     
  Branches      297      297           
=======================================
+ Hits         1581     1584    +3     
  Misses         14       14           
  Partials       20       20           
Files with missing lines Coverage Δ
scrapy_zyte_api/_middlewares.py 97.65% <100.00%> (+0.05%) ⬆️

@Gallaecio Gallaecio requested review from kmike and wRAR December 16, 2024 09:21
@wRAR
Copy link
Contributor

wRAR commented Dec 16, 2024

Thanks!

@wRAR wRAR merged commit 9ce3d30 into scrapy-plugins:main Dec 16, 2024
19 checks passed
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.

Switch to get_slot_key() when available
3 participants