snowplow / snowplow-badrows

Apache License 2.0
7 stars 2 forks source link

Make it possible to contain multiple messages for CPFormatViolation #51

Open chuwy opened 4 years ago

chuwy commented 4 years ago

In enrich we techincally can extract 1+ FailureDetails.CPFormatViolationMessage. But since Failure.CPFormatViolation supports only single message, we're forced to return NonEmptyList[BadRow.CPFormatViolation] in loaders, which is confusing and misleading - only single payload or single error can be returned by toCollectorPayload.

An easier workaround would be to short-circuit toCollectorPayload on first error as it's rare enough for two errors to happen at once, but I'd like to preserve as much info as possible.

chuwy commented 4 years ago

This should be collector_payload_format_violation/2-0-0 and since we're bumping model anyway, it's worth to change property names to something less ambigous, e.g. messages to cpFormatViolationMessages - a very long name, but I think this namespacing is the best way to avoid collisions #50