Skip to content

Conversation

Bidek56
Copy link
Collaborator

@Bidek56 Bidek56 commented Aug 14, 2025

Adding lit_series func to lit Series into LiteralValue to close #351

@Bidek56 Bidek56 self-assigned this Aug 14, 2025
@Bidek56 Bidek56 added the enhancement New feature or request label Aug 14, 2025
@universalmind303
Copy link
Collaborator

so i think we need to be pretty careful about adding this in to the lazy dsl. The lazyframes will do broadcasting which can be very confusing and produce unexpected results.

as such this is invalid.

pl.DataFrame({"text": ["hello"]}).lazy().select("text", pl.Series("series",[1,2,3])).collectSync()

but these are valid

pl.DataFrame({"text": ["hello"]}).lazy().select(pl.Series("series",[1,2,3])).collectSync()
pl.DataFrame({"text": ["hello"]}).lazy().select("text", pl.Series("series",[1])).collectSync()

If we want to introduce this, we'll need A LOT more tests to ensure broadcasting and various edge cases are consistent with rs and py polars.

@Bidek56
Copy link
Collaborator Author

Bidek56 commented Aug 15, 2025

so i think we need to be pretty careful about adding this in to the lazy dsl. The lazyframes will do broadcasting which can be very confusing and produce unexpected results.

as such this is invalid.

pl.DataFrame({"text": ["hello"]}).lazy().select("text", pl.Series("series",[1,2,3])).collectSync()

but these are valid

pl.DataFrame({"text": ["hello"]}).lazy().select(pl.Series("series",[1,2,3])).collectSync()
pl.DataFrame({"text": ["hello"]}).lazy().select("text", pl.Series("series",[1])).collectSync()

If we want to introduce this, we'll need A LOT more tests to ensure broadcasting and various edge cases are consistent with rs and py polars.

The cases shown above behave the same as in py polars. I will look for more test cases. Thx

Copy link
Collaborator

@universalmind303 universalmind303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cases shown above behave the same as in py polars. I will look for more test cases. Thx

if it works in py-ppolars, thats good enough for me!

@Bidek56
Copy link
Collaborator Author

Bidek56 commented Aug 21, 2025

The cases shown above behave the same as in py polars. I will look for more test cases. Thx

if it works in py-ppolars, thats good enough for me!

This PR fixes series struct tests, which is a big win!

@Bidek56 Bidek56 merged commit 7729376 into pola-rs:main Aug 21, 2025
12 checks passed
@Bidek56 Bidek56 deleted the issue-351 branch August 21, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a Series to a LazyDataFrame is treated as adding a literal value to it
2 participants