JakobGM / patito

A data modelling layer built on top of polars and pydantic
MIT License
252 stars 23 forks source link

[FEAT] Ignore validation errors #37

Open s-breeze opened 6 months ago

s-breeze commented 6 months ago

Is there a way to configure patito Models to ignore certain validation errors (e.g. type_error.superfluoscolumns) in the model class rather than catching and checking errors?

dsgibbons commented 1 day ago

patito.validators.validate has an allow_superfluous_columns argument (https://github.com/JakobGM/patito/blob/main/src/patito/validators.py#L89). Can you give an example where you need this logic to live in the model rather than in the call to validate?