-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(python): Simultaneous usage of named_expr
and schema
in pl.struct
#17768
fix(python): Simultaneous usage of named_expr
and schema
in pl.struct
#17768
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17768 +/- ##
==========================================
- Coverage 80.44% 80.42% -0.02%
==========================================
Files 1502 1502
Lines 197073 197075 +2
Branches 2794 2794
==========================================
- Hits 158539 158503 -36
- Misses 38020 38058 +38
Partials 514 514 ☔ View full report in Codecov by Sentry. |
def test_named_exprs() -> None: | ||
df = pl.DataFrame({"a": 1}) | ||
schema = {"b": pl.Int64} | ||
res = df.select(pl.struct(schema=schema, b=pl.col("a"))) |
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.
res
and expect
seem to be the exact same query. Can you check the valid outputs via a assert res.to_dict(as_series=False) == expected
and a res.schema == expected_schema
?
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.
Sure, I made that part more direct. Thanks @ritchie46 .
Thanks |
…truct` (pola-rs#17768) Co-authored-by: Casagrande, Sandro <sandro.casagrande@techem.de>
Resolves #16509
The fix seem very simple. I added a test that shows the (imho) expected behavior.