Skip to content

Commit

Permalink
test(python): test lit series arithmetic order (pola-rs#7015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored and josemasar committed Feb 21, 2023
1 parent e7f34cf commit f7a581f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions py-polars/tests/unit/test_arity.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ def test_nested_when_then_and_wildcard_expansion_6284() -> None:
"2": ["c", "d"],
"result": ["a", "d"],
}


def test_expression_literal_series_order() -> None:
s = pl.Series([1, 2, 3])
df = pl.DataFrame({"a": [1, 2, 3]})

assert df.select(pl.col("a") + s).to_dict(False) == {"a": [2, 4, 6]}
assert df.select(pl.lit(s) + pl.col("a")).to_dict(False) == {"": [2, 4, 6]}

0 comments on commit f7a581f

Please sign in to comment.