When inheriting a SchemaModel, I would expect that the Config class gets inherited with it, so that Schema-wide parameters such as unique are present in downstream model. This would be consistent with pydantic's handling thereof.
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandera.
[ ] (optional) I have confirmed this bug exists on the master branch of pandera.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
from pandera import SchemaModel
from pandera.typing import Series
class Model1(SchemaModel):
col1: Series[int]
class Config:
unique=['col1']
class Model2(Model1):
col2: Series[str]
assert Model1.Config.unique == Model2.Config.unique
Expected behavior
Expected behaviour would be similar to pydantic.
from pydantic import BaseModel
class Model1(BaseModel):
col1: str
class Config:
unique = ['col1']
class Model2(Model1):
col2: str
assert Model1.Config.unique == Model2.Config.unique
Desktop (please complete the following information):
OS: ubuntu, macOs
Screenshots
If applicable, add screenshots to help explain your problem.
Describe the bug
!Not sure if a bug or design choice!
When inheriting a SchemaModel, I would expect that the Config class gets inherited with it, so that Schema-wide parameters such as
unique
are present in downstream model. This would be consistent withpydantic
's handling thereof.Also asked on SO here.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Expected behavior
Expected behaviour would be similar to pydantic.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.