We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
join
@nameexhaustion: Up for another one? 😉
import polars as pl lf1 = pl.LazyFrame({ "a": [1, 2, 3, 4, 5], "b": [1, 2, 3, 4, 5], }) lf2 = pl.LazyFrame({ "a": [0, 2, 3, 4, 5], "b": [1, 2, 3, 5, 6], "c": [7, 5, 3, 5, 7], }) lf3 = lf1.join( other = lf2, how = "inner", left_on = ["a", "a"], # << note: joining on `a = b` *and* `a = c` right_on = ["b", "c"], coalesce = False, ) lf3.collect() # shape: (2, 5) # ┌─────┬─────┬─────────┬─────────┬─────┐ # │ a ┆ b ┆ a_right ┆ b_right ┆ c │ # │ --- ┆ --- ┆ --- ┆ --- ┆ --- │ # │ i64 ┆ i64 ┆ i64 ┆ i64 ┆ i64 │ # ╞═════╪═════╪═════════╪═════════╪═════╡ # │ 3 ┆ 3 ┆ 3 ┆ 3 ┆ 3 │ # │ 5 ┆ 5 ┆ 4 ┆ 5 ┆ 5 │ # └─────┴─────┴─────────┴─────────┴─────┘
Now select the columns "a", "b", and "c" from that same LazyFrame:
LazyFrame
lf3.select("a", "b", "c").collect() # DuplicateError: the name: 'a' is duplicate
Selecting columns from a post-join LazyFrame can raise an erroneous DuplicateError.
DuplicateError
The above join + select operation should result in the following frame:
join + select
# shape: (2, 3) # ┌─────┬─────┬─────┐ # │ a ┆ b ┆ c │ # │ --- ┆ --- ┆ --- │ # │ i64 ┆ i64 ┆ i64 │ # ╞═════╪═════╪═════╡ # │ 3 ┆ 3 ┆ 3 │ # │ 5 ┆ 5 ┆ 5 │ # └─────┴─────┴─────┘
Compiled current main (as of a few minutes ago) with all standard features.
main
The text was updated successfully, but these errors were encountered:
JOIN
@nameexhaustion can you take a look?
Sorry, something went wrong.
Will take a look
nameexhaustion
Successfully merging a pull request may close this issue.
@nameexhaustion: Up for another one? 😉
Checks
Reproducible example
Now select the columns "a", "b", and "c" from that same
LazyFrame
:Issue description
Selecting columns from a post-join
LazyFrame
can raise an erroneousDuplicateError
.Expected behavior
The above
join + select
operation should result in the following frame:Installed versions
Compiled current
main
(as of a few minutes ago) with all standard features.The text was updated successfully, but these errors were encountered: