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 - Atualizando versão do requests fingerprint #1307

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

jjpaulo2
Copy link
Contributor

@jjpaulo2 jjpaulo2 commented Oct 23, 2024

Motivação

Todos os spiders estão lançando este warning. Para remover ele, apenas segui a recomendação da documentação de usar a versão 2.7, dado que já estamos usando o scrapy 2.11.

Esse é um recurso que é usado para evitar a duplicação de requisições feitas pelo Scrapy. A maior parte dos recursos afetados por essa atualização são coisas relacionadas à cache de requests, e o projeto não usa nada disso.

[py.warnings] WARNING: /Users/.../.virtualenvs/querido-diario-dvpf/lib/python3.10/site-packages/scrapy/utils/request.py:254: ScrapyDeprecationWarning: '2.6' is a deprecated value for the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting.

It is also the default value. In other words, it is normal to get this warning if you have not defined a value for the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting. This is so for backward compatibility reasons, but it will change in a future version of Scrapy.

See the documentation of the 'REQUEST_FINGERPRINTER_IMPLEMENTATION' setting for information on how to handle this deprecation.
  return cls(crawler)

Eu rodei alguns spiders aleatórios para garantir que nada estava quebrando, e de fato as requisições continuam rodando perfeitamente.

Referência

Requests and Responses — Scrapy 2.11.2 documentation

@jjpaulo2
Copy link
Contributor Author

@trevineju pra conseguir caminhar com a evolução do script em #1284, é importante removermos esse warning pra não gerar nenhum "falso negativo" no teste.

@trevineju trevineju added the hacktoberfest-accepted Pull Requests aprovados na Hacktoberfest label Oct 24, 2024
@trevineju
Copy link
Member

trevineju commented Oct 24, 2024

o único problema de atualizar a versão do fingerprint é o scrapy perder a referência das últimas URLs acessadas... mas isso não vai impactar a coleta diária. Talvez impacte a próxima coleta mensal individualmente, mas se os metadados não mudarem, o banco não vai permitir re-adicionar documentos repetidos. E se mudarem, já conhecemos o rastro que deixa no banco. Então acredito que o impacto é mínimo.

Estou aprovando a PR

Copy link
Member

@trevineju trevineju left a comment

Choose a reason for hiding this comment

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

@trevineju trevineju merged commit bd38b46 into okfn-brasil:main Oct 24, 2024
1 check passed
@jjpaulo2 jjpaulo2 deleted the fix/requests-fingerprint branch October 24, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Pull Requests aprovados na Hacktoberfest
Projects
Status: em produção
Development

Successfully merging this pull request may close these issues.

2 participants