-
Notifications
You must be signed in to change notification settings - Fork 24
[FEAT] Ignore validation errors #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
Patito should be better integrated with pydantic features. Configuration should be set in from pydantic import BaseModel, ConfigDict
import patito as pt
class PydanticModel(BaseModel):
model_config = ConfigDict(extra="allow")
a: int
PydanticModel.model_validate({"a" : 1, "b": 1}) # works
# PydanticModel(a=1, b=1)
class Model(pt.Model):
model_config = ConfigDict(extra="allow")
a: int
Model.validate(Model.examples().with_columns(b = 1)) # fails
# Superfluous column (type=type_error.superfluouscolumns)
|
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?The text was updated successfully, but these errors were encountered: