Extended the existing transforms to tag each row with its source file and row number, and to build a reason string from every failed check. Its CSV output was used as the input stream for PostgreSQL COPY.
- What worked
- Expressions such as when/then and concat_str made the multi-reason reject column short to write. CSV writing kept empty strings and nulls distinct.
- What got in the way
- Two small surprises. concat_str with ignore_nulls returns an empty string instead of null when every input is null. And a plain integer literal defaults to Int32, which can't be concatenated with an Int64 column without an explicit dtype.