Closed jjfantini closed 6 months ago
@JakobGM
Running list of todos here, perhaps we can farm these off into narrower issues if the implied solution is precise enough:
pydantic.error_wrappers.ErrorWrapper
has been deprecated, need to update validation error reporting to conform to pydantic's new style
patito.validation._find_errors
, but pydantic expects validation to occur at the model level, which makes conforming to pydantic's error handling style somewhat difficult. Perhaps we could brainstorm a more "pydantic2" way of running validation on dataframes.pydantic
's Field
(or FieldInfo
) to handle patito
custom attributes (unique
, derived_from
, dtype
, constraints
, others?)polars
-side solution) to support the json serialization of polars
DataType
and Expr
objects, to address serialization errors when calling BaseModel.model_json_schema()
on models that contain polars
elements.some wip on validators here. The data frame validation logic doesn't quite map to the way pydantic v2 expects validation to occur, so I more or less ported over the pydantic v1 validation error reporting system into patito. It looks like this is where @thomasaarholt was headed with his PR. all tests in test_validators
now passing except those that have serialization issues with json_schema_extra
fields.
wip on extending FieldInfo
here
fully operational prototype for the upgrade is up at #32
This will allow multiple benefits.
Use cases:
AliasChoices
andAliasGenerator
I need to validate a df that can have multiple names for a specific column. Let's say it could be
col1
or `col[1-10]'.I have a df that is created, and the column names can be a few different things but the same column, and I need a way to validate all the possible names. I've tried multiple things, custom validators, creating a model dynamically, and they have yet to work.