scrapy / itemadapter

Common interface for data container classes
BSD 3-Clause "New" or "Revised" License
62 stars 13 forks source link

Raise custom exception instead of TypeError in get_field_meta #19

Closed elacuesta closed 4 years ago

elacuesta commented 4 years ago

Fixes #6

I changed my mind about what I said in https://github.com/scrapy/scrapy/pull/3881#discussion_r428301072, I'd prefer to keep a consistent return type in get_field_meta, which won't happen if we add a default parameter.

codecov[bot] commented 4 years ago

Codecov Report

Merging #19 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         3    +1     
  Lines           93        95    +2     
=========================================
+ Hits            93        95    +2     
Impacted Files Coverage Δ
itemadapter/adapter.py 100.00% <100.00%> (ø)
itemadapter/exceptions.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d018404...fd768f8. Read the comment docs.

elacuesta commented 4 years ago

Alternative implementation in 3594f8f52767e499c86182e25509dce893cbf6ae