JakobGM / patito

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

Fix validating enum when field is optional. #76

Closed vosskj03 closed 1 month ago

vosskj03 commented 1 month ago

Updates the validator to do an enum check when the field is optional.

thomasaarholt commented 1 month ago

Thank you @vosskj03! Could you add a test case covering the case where this is needed?

vosskj03 commented 1 month ago

No problem! After looking over the tests I did a minor refactor of the enum validation in _find_enum_errors and added two new tests.

thomasaarholt commented 1 month ago

Thank you!