@pandera.check_types
+ pandera.typing.Series[...]
type hints = *whole lotta nuthin'*
#1527
-
This is your friendly neighbourhood @beartype developer @leycec. Hi, everybody! Pandera makes even my cats happy. 😸 @beartype has officially supported pandera for a year or so. Because of that, I've been fielding increasingly many @beartype issues, feature requests, and discussions pertaining to pandera. The problem is that I have no idea what I'm doing. Pandera is a vast supernova of typing I only dimly pretend to understand. In this discussion, I'd like to upstream issue beartype/beartype#337 directly to the wonderful pandera community. @beartype user @komodovaran intends to type-check a variety of pandas objects via the standard decorator pattern. Pandera trivially supports type-checking So far, so good.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
So 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 See #688 for previous discussion on this topic. |
Beta Was this translation helpful? Give feedback.
-
Gotcha! Thanks a heap for your detailed writeup. That... totally makes sense. Is there any other means of type-checking No worries either way. I'd imagine you have significantly bigger fish to fry. There's always a bigger fish. 😄 |
Beta Was this translation helpful? Give feedback.
So
pandera.typing.Series[int]
is only meant as purely metadata forDataFrameModel
. Now it's not even necessary when definingDataFrameModel
.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
orwarning
in the docs saying that@pa.check_types
only works forDataFrameModel
and not forpandera.typing.Series[TYPE]
.See #688 for previous discussion on this topic.