Skip to content

Commit

Permalink
test(python): test lit series arithmetic order (#7015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Feb 19, 2023
1 parent a07d1ff commit be126b3
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 be126b3

Please sign in to comment.