Skip to content

Commit

Permalink
test: add test cases.
Browse files Browse the repository at this point in the history
Signed-off-by: yassun7010 <[email protected]>
  • Loading branch information
yassun7010 committed Oct 5, 2024
1 parent e04419b commit 5c52f3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/core/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,3 +1515,15 @@ def sqrt(cls, series):
assert Schema.validate(df).equals( # type: ignore [attr-defined]
pd.DataFrame({"a": [11.0], "abc": [1.0], "cba": [200.0]})
)


def test_pandera_dtype() -> None:
class Schema(pa.DataFrameModel):
a: Series[pa.Float]
b: Series[pa.Int]
c: Series[pa.String]

df = pd.DataFrame({"a": [1.0], "b": [1], "c": ["1"]})
assert Schema.validate(df).equals( # type: ignore [attr-defined]
pd.DataFrame({"a": [1.0], "b": [1], "c": ["1"]})
)

0 comments on commit 5c52f3a

Please sign in to comment.