-
-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pandera Polars datatype 'check' method is not provided a 'data_container' #1616
Comments
this is a bug! looking into it |
Okay, so this should fix it: from pandera.api.polars.types import PolarsData
...
CoreCheckResult(
passed=schema.dtype.check(
obj_dtype,
PolarsData(check_obj_subset, schema.selector),
),
...
) Would you be able to open up a PR with some unit tests? |
Yes, I will be happy to do so later this evening. Thank you very much |
@cosmicBboy I have created the pr for this change. |
Apologies if you clicked that while it was deleted, recreated to address the signoff requirement #1623 |
fixed by #1623 |
Describe the bug
When registering a custom datatype in the polars_engine, the check function is only able to do dtype validation, not validation across the data_container like we are able to do in the example here: https://pandera.readthedocs.io/en/stable/dtypes.html#logical-data-types.
I am curious if this is intentional, or if this validation would be a desired enhancement. If so, I would be happy to create a PR for this change. Thank you.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Expected behavior
I am expecting my 'check' method to be provided a reference to the data_container when working with the polars_engine, similar to how the pandas implementation works.
Desktop (please complete the following information):
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
This is because the call to our schema.dtype.check is not provided the check_obj here:
pandera/pandera/backends/polars/components.py
Line 325 in 612d25c
Where the pandas implementation is providing this check_obj here
pandera/pandera/backends/pandas/array.py
Lines 286 to 289 in 612d25c
The text was updated successfully, but these errors were encountered: