-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix validation and coercion on init bug (#1868)
* fix validation and coercion on init bug Signed-off-by: Niels Bantilan <[email protected]> * fix test Signed-off-by: Niels Bantilan <[email protected]> --------- Signed-off-by: Niels Bantilan <[email protected]>
- Loading branch information
1 parent
0d5d05d
commit efcd7b1
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"""Module for unit testing validation on initialization.""" | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import pandera as pa | ||
from pandera.typing import DataFrame | ||
|
||
|
||
class ExampleSchema(pa.DataFrameModel): | ||
class Config: | ||
coerce = True | ||
|
||
a: np.int64 | ||
|
||
|
||
ExampleDataFrame = DataFrame[ExampleSchema] | ||
validated_dataframe = ExampleDataFrame(pd.DataFrame([], columns=["a"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters