Closed d-chambers closed 3 years ago
hi @d-chambers, I'm glad you're finding pandera useful!
Yes, completely agreed that the parsing functionality of pydantic is a super useful feature to have.
See #252 for previous discussion about this topic. pydantic and pandera's designs do sort of differ in that pydantic is a parser first, a validation library second, while pandera is primarily a validation tool (with type coercion being the only supported parsing functionality).
I do want to add native support for parsing soon, but I do want to design this carefully to suit dataframes and pandera's schema specification model.
IMO pydantic's validator
decorator is a bit of a misnomer, as what it's doing is (i) parsing raw data values and (ii) emitting an error in the case of invalid ones, going to discuss a more fleshed-out proposal in #252, feel free to add your thoughts!
closing this, merging with #252
Hi,
I just found pandera and I am very pleased with the pydantic style support for dataframes. However, one feature that is missing is validators, which, in pydantic, are different from pandera's checks in that they can change/correct values or raise validation errors. From my understanding pandera's checks must always return a boolean indicating if the row is correct and therefore cannot make corrections where desirable.
If validators are not supported, and there is not a better way to do it that I am missing, would you consider a PR adding them? I am thinking something like this:
Thanks for working on this great library.