-
Couldn't load subscription status.
- Fork 2.4k
feat: Expose assert_frame_schema_equal in py-polars #24869
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
base: main
Are you sure you want to change the base?
feat: Expose assert_frame_schema_equal in py-polars #24869
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24869 +/- ##
=======================================
Coverage 81.73% 81.73%
=======================================
Files 1700 1700
Lines 233986 234005 +19
Branches 2993 2994 +1
=======================================
+ Hits 191254 191270 +16
- Misses 41971 41973 +2
- Partials 761 762 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Bumping @coastalwhite, @ritchie46 This looks good to me |
|
I think the Python API and the Rust API are a bit different here. I would rather have a This would also remove the problem with |
|
@coastalwhite the lazyfram.collect is a good catch. Didn't think that one trough! Thanks 😄 To understand a bit more of what you propose - do you suggest to create a completely rewrite of assert schema in Python? Or should I extend my PR to make assert_dataframe_schema_equal to actually be a thing wrapper that just get left/right_schema and then send it into a new rust function assert_schema_equal, which I then expose to the Python API instead of my current solution? |
|
@coastalwhite Having thought on it a bit more. What do you think if I :
|
90ceb7b to
e9fce55
Compare
PR description
This PR exposes assert_frame_schema_equal as a public Rust function and makes it available in Python.
Previously, Python users only had access to assert_frame_equal and assert_frame_not_equal. The underlying Rust function assert_frame_schema_equal has so far been private and used internally by those two assertions.
Making it public enables lightweight schema validation directly in Python, without relying on heavier validation frameworks like pandera. This can improve user feedback in data applications before persisting data to a database.
Closes #21215.
Review suggestions