Skip to content

@pandera.check_types + pandera.typing.Series[...] type hints = *whole lotta nuthin'* #1527

Answered by cosmicBboy
leycec asked this question in Q&A
Discussion options

You must be logged in to vote

So pandera.typing.Series[int] is only meant as purely metadata for DataFrameModel. Now it's not even necessary when defining DataFrameModel.

from pandera import DataFrameModel
from pandera.typing import Series

# original syntax
class Model(DataFrameModel):
    x: Series[int]

# newer syntax
class Model(DataFrameModel):
    x: int

Not against proper support for this, but I was going more for "if it's not documented, the feature doesn't exist" approach to this. In hindsight, it's probably a good idea to add some kind of note or warning in the docs saying that @pa.check_types only works for DataFrameModel and not for pandera.typing.Series[TYPE].

See #688 for previous discussion on this topic.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by leycec
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants