Skip to content
New issue

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

Fix aggregations on a self-referencing if_else #441

Closed
jaychia opened this issue Jan 13, 2023 · 0 comments · Fixed by #446
Closed

Fix aggregations on a self-referencing if_else #441

jaychia opened this issue Jan 13, 2023 · 0 comments · Fixed by #446
Labels
bug Something isn't working

Comments

@jaychia
Copy link
Contributor

jaychia commented Jan 13, 2023

Describe the bug
Aggregations on self-referencing if_else is broken:

def test_repro():
    daft_df = DataFrame.from_pydict(GROUPBY_DATA).repartition(2)
    daft_df = daft_df.with_column(
        "weight", (col("size") == "S").if_else(1, col("weight"))
    )
    daft_df = daft_df.groupby(col("animal")).agg([(col("weight"), "mean")])
    daft_df.collect()

The above breaks with a missing ID during a projection step. It seems that the optimizer erroneously omits the "weight" column when doing column pruning.

@jaychia jaychia added the bug Something isn't working label Jan 13, 2023
@jaychia jaychia linked a pull request Jan 17, 2023 that will close this issue
jaychia added a commit that referenced this issue Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant