test(python): DataFrame construction with mixed ints and floats in list#25823
test(python): DataFrame construction with mixed ints and floats in list#25823DeflateAwning wants to merge 5 commits intopola-rs:mainfrom
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.
Can you use assert_frame_equal to simultaneously test schema and values?
There was a problem hiding this comment.
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.
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.