Closed ion-elgreco closed 3 months ago
Nested literals in a list are not properly evaluated for invalid values, see example below:
import patito as pt import polars as pl from typing import Literal class TestModel(pt.Model): foo: list[Literal['abc']] = pt.Field(dtype=pl.List(pl.Utf8)) df = pl.DataFrame({ "foo": [['wrong']] }) TestModel.validate(df)
This should actually throw an error
@thomasaarholt @brendancooley fyi ;)
Thanks! I'll see if I can find time to look at it this week!
Taking a peak now, hopefully quick fix
Nested literals in a list are not properly evaluated for invalid values, see example below:
This should actually throw an error