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

Switch auto field stats to an item pipeline #216

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Gallaecio
Copy link
Contributor

@Gallaecio Gallaecio commented Aug 26, 2024

I was asked to support non-standard, custom items for auto field stats.

To achieve that, it seemed easier to switch the implementation to an item pipeline.

It also feels like this feature would make sense in scrapy-poet now. But I am not 100% sure, and I also would not want to move it until scrapy-poet gained add-on support.

To do:

@Gallaecio Gallaecio requested review from kmike and wRAR August 26, 2024 20:57
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.85%. Comparing base (106b099) to head (a89f3b7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scrapy_zyte_api/_poet_item_pipelines.py 98.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #216      +/-   ##
==========================================
+ Coverage   97.67%   97.85%   +0.17%     
==========================================
  Files          14       16       +2     
  Lines        1550     1585      +35     
  Branches      327      333       +6     
==========================================
+ Hits         1514     1551      +37     
+ Misses         15       12       -3     
- Partials       21       22       +1     
Files with missing lines Coverage Δ
scrapy_zyte_api/addon.py 98.14% <100.00%> (+0.07%) ⬆️
scrapy_zyte_api/poet.py 100.00% <100.00%> (ø)
scrapy_zyte_api/providers.py 93.00% <100.00%> (-1.15%) ⬇️
scrapy_zyte_api/_poet_item_pipelines.py 98.30% <98.30%> (ø)

... and 2 files with indirect coverage changes

@kmike
Copy link
Member

kmike commented Aug 29, 2024

The code looks good 👍 But I haven't checked how it works, and if it solves the issue :)

logger = getLogger(__name__)


class ScrapyZyteAPIAutoFieldStatsItemPipeline:
Copy link
Member

Choose a reason for hiding this comment

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

Moving it to scrapy-poet might allow to make the name shorter :)

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.

3 participants