Conversion from 1 pydantic dtype dataframe to another fails when strict = 'filter' #1511
Open
2 of 3 tasks
Labels
bug
Something isn't working
Describe the bug
Converting from one pydantic dtype pandera DataFrame to another without strict = 'filter' drops columns, but when strict = 'filter' the conversion errors.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
yields
Expected behavior
I expected tdf2 to be successfully created with columns a and b (dropping column c), but only when strict = 'filter', and not without it.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Pandera rocks. I am so happy to have something to validate my dataframes in a clean way. I really love the ability to make a dataframe based on Pydantic Models. It gives a lot reusability to the types, letting them pull triple duty around sqlmodel, fastapi, and dataframe all from one convenient definition. It's awesome that pandera has the strict = 'filter' to drop extra columns, and combining these two things gives a nice way to do automatic conversions. It's counterintuitive to me that it would drop the extra columns when filter is not set, though maybe I'm not understanding something.
The text was updated successfully, but these errors were encountered: