zytedata / zyte-common-items

Contains the common item definitions used in Zyte.
BSD 3-Clause "New" or "Revised" License
9 stars 6 forks source link

helper method: get_probability() #64

Closed BurnzZ closed 1 year ago

BurnzZ commented 1 year ago

This makes it slightly easier to access the probability value in the spider. It also avoids the redundant code that checks if metadata is present in case the instance is a Request and not a ProbabilityRequest.

codecov-commenter commented 1 year ago

Codecov Report

Merging #64 (2f51e68) into main (c162726) will not change coverage. The diff coverage is 0.00%.

:exclamation: Current head 2f51e68 differs from pull request most recent head 70fc2d1. Consider uploading reports for the commit 70fc2d1 to get more accurate results

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #64 +/- ## ===================================== Coverage 0.00% 0.00% ===================================== Files 8 8 Lines 867 870 +3 ===================================== - Misses 867 870 +3 ``` | [Files](https://app.codecov.io/gh/zytedata/zyte-common-items/pull/64?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [zyte\_common\_items/components.py](https://app.codecov.io/gh/zytedata/zyte-common-items/pull/64?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-enl0ZV9jb21tb25faXRlbXMvY29tcG9uZW50cy5weQ==) | `0.00% <0.00%> (ø)` | |