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

Deprecate the spider argument to Downloader._get_slot_key() #6340

Closed
wRAR opened this issue May 6, 2024 · 3 comments · Fixed by #6352
Closed

Deprecate the spider argument to Downloader._get_slot_key() #6340

wRAR opened this issue May 6, 2024 · 3 comments · Fixed by #6352
Labels

Comments

@wRAR
Copy link
Member

wRAR commented May 6, 2024

The spider argument is not used inside the method since 2012, but we can't remove it as external code calls it (either because it subclasses Downloader or because it wants the slot name).

Actually maybe we want to promote it to a public method for the second reason? Not sure how often it's needed but see e.g. https://github.com/scrapy-plugins/scrapy-zyte-api/blob/a2284c8cdf157ef6d36c1cc413933761c5ed792b/scrapy_zyte_api/_middlewares.py#L32

@Gallaecio
Copy link
Member

+1 to make it public.

Although I wonder if, for examples like the linked one, the right approach could be to allow customizing how slots IDs are generated instead.

@kumar-sanchay
Copy link
Contributor

@wRAR do you want to promote this method to public and keep the old method with some Deprecate message ?

@wRAR
Copy link
Member Author

wRAR commented May 9, 2024

Yeah, let's make it public and without the extra argument and keep the old one with a deprecation warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants