How do you design and implement automated data quality and testing frameworks using tools like Python or Great Expectations?
Implement validate_records(records, required_fields, unique_fields, numeric_ranges) as a lightweight Python quality framework. Return a deterministic report identifying missing fields, invalid numeric ranges, and duplicate unique-field values. The output must contain valid and row-level errors fields.
def validate_records(records, required_fields, unique_fields, numeric_ranges):