JakobGM / patito

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

Allow constraints columnar-wise with multi-column support #14

Closed ion-elgreco closed 12 months ago

ion-elgreco commented 1 year ago

Currently the constraints are row-wise, but it would be nice to have the option to add columnar type of constraints or multi-columnar.

This way you can do unique check on multiple columns for example.

ion-elgreco commented 12 months ago

Actually never mind :)

I can also just add pl.struct('a', 'b').is_unique(), and put it as a constraint on a or b