Describe the bug
A clear and concise description of what the bug is.
☒ I have checked that this issue has not already been reported.
☒ 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
import pandera as pa
from pandera.typing import Index, Series
class MultiIndexSchema(pa.SchemaModel):
year: Index[int] = pa.Field(gt=2000, coerce=True)
month: Index[int] = pa.Field(ge=1, le=12, coerce=True)
passengers: Series[int]
class Config:
# provide multi index options in the config
multiindex_name = "time"
multiindex_strict = True
multiindex_coerce = True
multiindex_unique = True
index = MultiIndexSchema.to_schema().index
Expected behavior
I would expect SchemaModel and schema objects to have the same functionality, including for validation of multi index, including all the flags passed to the MultIndex class.
Desktop (please complete the following information):
OS: linux (ubuntu, rh8)
Version: latest
Additional context
Ideally there should be a test that the features are the same. I'm happy to fix this bug (as it is a simple one-liner), but there probably should be more reflection on how to make sure that the features don't diverge between the 2 syntax. I will try to submit a PR, this is a great project, I hope I will be able to contribute in the future.
Describe the bug A clear and concise description of what the bug is.
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
I would expect SchemaModel and schema objects to have the same functionality, including for validation of multi index, including all the flags passed to the MultIndex class.
Desktop (please complete the following information):
Additional context
Ideally there should be a test that the features are the same. I'm happy to fix this bug (as it is a simple one-liner), but there probably should be more reflection on how to make sure that the features don't diverge between the 2 syntax. I will try to submit a PR, this is a great project, I hope I will be able to contribute in the future.