Closed VMRuiz closed 1 year ago
Patch coverage has no change and project coverage change: +0.12%
:tada:
Comparison is base (
a75cf97
) 78.52% compared to head (1347209
) 78.64%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The error raised in these lines https://github.com/scrapinghub/spidermon/pull/414/files#diff-877bfbf0203e928b3c50d4dadb782369861cf83240c9d0721ed1f7dd791a6406R140-R145 may be a bug.
Spidermon should allow setting the default value in classes that supports using additional fields like dicts
but that doesn't support __setitem__
method. I can fix it by using setattr(item, self.errors_field, defaultdict(list)
instead of item[self.errors_field] = defaultdict(list)
. However I prefer to merge this first and fix it in a new PR.
Also, it should check that data[self.errors_field] is not None
to cover the cases where the field was defined but was given a None
value as default.
The current spidermon behavior for adding
_validation
field to items seems to be a bit controversial: https://github.com/scrapinghub/spidermon/issues/379To make easier to track changes, I have implemented some additional tests that covers the current logic.