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

[BUG] Fix if_else series naming from predicate broadcast #2051

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

colin-ho
Copy link
Contributor

@colin-ho colin-ho commented Mar 29, 2024

When predicate is broadcasted in the if_else kernel and the predicate is false, the if_false series is cloned and the name is unchanged, which causes a

ValueError: DaftError::ComputeError Mismatch of expected expression name and name from computed series

at expression evaluation time because the expected field name is the if_true series name.

Example code to reproduce:

df = daft.from_pydict({"predicate": [False], "if_true": ["true"], "if_false": ["false"]})
df = df.select((df["predicate"] == True).if_else(df["if_true"], df["if_false"]))
df.show()

@github-actions github-actions bot added the bug Something isn't working label Mar 29, 2024
@colin-ho colin-ho merged commit de48128 into main Mar 29, 2024
31 checks passed
@colin-ho colin-ho deleted the colin/fix-if-else branch March 29, 2024 19:36
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 this pull request may close these issues.

2 participants