Problem: JSON Serialization Issue with Polars Time Data Type in Error Reporting #1841
Open
2 of 3 tasks
Labels
bug
Something isn't working
Describe the bug
When validating Polars DataFrames containing columns with the Time or pl.Time data type using pandera, a PanicException occurs during error reporting due to an incompatibility with JSON serialization.
Checks
Code Sample:
Steps to Reproduce:
Expected behavior
pandera should gracefully handle the validation error and provide a detailed error report, including information about the failed values.
Actual behavior
A PanicException is raised with the message "not yet implemented: Writing Time64(Nanosecond) to JSON". This is because Polars' internal representation of Time as Time64(Nanosecond) does not have a direct JSON equivalent, and pandera's error reporting mechanism relies on JSON serialization.
Screenshots
Workaround:
Currently, a workaround involves catching the PanicException and manually handling the error reporting. However, this approach is not ideal and requires custom code.
Additional Context:
This issue likely stems from the inherent limitation of JSON in representing specific data types like Time. Addressing this within pandera would significantly improve its usability for Polars users.
The text was updated successfully, but these errors were encountered: