Skip to content

Commit

Permalink
join expression argument fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Aug 6, 2022
1 parent 093d55c commit 18027ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions polars/polars-lazy/src/logical_plan/alp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,10 +799,9 @@ impl<'a> ALogicalPlanBuilder<'a> {

let right_names: PlHashSet<_> = right_on
.iter()
.map(|e| match self.expr_arena.get(*e) {
AExpr::Alias(_, name) => name.clone(),
AExpr::Column(name) => name.clone(),
_ => panic!("could not determine join column names"),
.map(|e| {
aexpr_to_root_column_name(*e, self.expr_arena)
.expect("could not determine join column names")
})
.collect();

Expand Down
3 changes: 3 additions & 0 deletions py-polars/tests/test_joins.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,6 @@ def test_join_on_cast() -> None:
"row_nr": [1, 2, 3, 5],
"a": [-2, 3, 3, 10],
}
assert df_a.lazy().join(
df_b.lazy(), on=pl.col("a").cast(pl.Int64)
).collect().to_dict(False) == {"row_nr": [1, 2, 3, 5], "a": [-2, 3, 3, 10]}

0 comments on commit 18027ff

Please sign in to comment.