Skip to content

Commit

Permalink
explicitly validate row dict
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpAribal committed Jun 19, 2024
1 parent efbaa91 commit ce0553f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandera/engines/pandas_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1318,9 +1318,9 @@ def _coerce_row(row):
try:
# pylint: disable=not-callable
if PYDANTIC_V2:
row = self.type(**row).model_dump()
row = self.type.model_validate(row).model_dump()
else:
row = self.type(**row).dict()
row = self.type.parse_obj(row).dict()
row["failure_cases"] = np.nan
except ValidationError as exc:
row["failure_cases"] = {
Expand Down

0 comments on commit ce0553f

Please sign in to comment.