unionai-oss / pandera

A light-weight, flexible, and expressive statistical data testing library
https://www.union.ai/pandera
MIT License
3.37k stars 310 forks source link

Regression: SchemaModel.field no longer resolves to `str` (descriptor typing needed) #738

Closed cristianmatache closed 2 years ago

cristianmatache commented 2 years ago

Code Sample, a copy-pastable example

import pandera.typing as pat
from pandera import SchemaModel

class Sch(SchemaModel):
    col: pat.Series[int]

print(type(Sch.col))   # str
reveal_type(Sch.col)   # note: Revealed type is "pandera.typing.pandas.Series[builtins.int]"

import pandera.typing.koalas as patk

class Sch2(SchemaModel):
    col: patk.Series[int]

print(type(Sch2.col))   # str
reveal_type(Sch2.col)   # note: Revealed type is "pandera.typing.koalas.Series[builtins.int]"

Expected behavior

The expected type should be str.

cosmicBboy commented 2 years ago

fixed by #739