-
Notifications
You must be signed in to change notification settings - Fork 2.5k
test(python): DataFrame construction with mixed ints and floats in list #25823
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?
test(python): DataFrame construction with mixed ints and floats in list #25823
Conversation
pl.DataFrame construction with mixed ints and floats in list
pl.DataFrame construction with mixed ints and floats in list
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25823 +/- ##
=======================================
Coverage 80.54% 80.54%
=======================================
Files 1761 1761
Lines 242251 242251
Branches 3043 3043
=======================================
+ Hits 195112 195127 +15
+ Misses 46358 46343 -15
Partials 781 781 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| def test_mixed_int_and_float_construction() -> None: | ||
| """Test that pl.DataFrame construction with mixed int/float data works.""" | ||
| df_1 = pl.DataFrame({"a": [1, 2, 3, 4, 5]}, schema={"a": pl.Float64}) | ||
| assert df_1.schema == {"a": pl.Float64} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use assert_frame_equal to simultaneously test schema and values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also curious what inspired you to add this test case out of the blue 😅 Is there a linked issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to use assert_frame_equal, thanks!
I was debugging an issue (sorta related to #25732, but only barely), and ended up with these tests that ruled out some suspected issues I was having.
Figured it's reasonably worth it to push it here as a validation that mixed-datatype frames get read correctly. Am often surprised that these sorts of things break between releases, and figured adding a test for it is a good way to catch it before it has a chance to break.
No description provided.