Skip to content

Conversation

@DeflateAwning
Copy link
Contributor

No description provided.

@DeflateAwning DeflateAwning changed the title test: pl.DataFrame construction with mixed ints and floats in list test: pl.DataFrame construction with mixed ints and floats in list Dec 18, 2025
@DeflateAwning DeflateAwning changed the title test: pl.DataFrame construction with mixed ints and floats in list test: DataFrame construction with mixed ints and floats in list Dec 18, 2025
@github-actions github-actions bot added A-dtype-struct Area: struct data type internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars and removed title needs formatting labels Dec 18, 2025
@DeflateAwning DeflateAwning changed the title test: DataFrame construction with mixed ints and floats in list test(python): DataFrame construction with mixed ints and floats in list Dec 18, 2025
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.54%. Comparing base (5dc5553) to head (6a42a98).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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}
Copy link
Member

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?

Copy link
Member

@orlp orlp Dec 22, 2025

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-dtype-struct Area: struct data type internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants