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

Alias doesn't work on main branch #447

Closed
xcharleslin opened this issue Jan 17, 2023 · 2 comments · Fixed by #448
Closed

Alias doesn't work on main branch #447

xcharleslin opened this issue Jan 17, 2023 · 2 comments · Fixed by #448
Labels
bug Something isn't working

Comments

@xcharleslin
Copy link
Contributor

from daft import DataFrame
df = DataFrame.from_pydict({"A": [1, 2], "B": [3, 4]})

df.select(df["A"].alias("A2")).collect()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/orbit/workspace/daft/daft/viz/dataframe_display.py", line 49, in __repr__
    return vpartition_repr(
  File "/home/orbit/workspace/daft/daft/viz/repr.py", line 159, in vpartition_repr
    data_stringified = _stringify_vpartition(
  File "/home/orbit/workspace/daft/daft/viz/repr.py", line 67, in _stringify_vpartition
    assert all(
AssertionError: Data does not contain columns: {'A2'}
@jaychia
Copy link
Contributor

jaychia commented Jan 17, 2023

Looks like a regression from a recent commit - I'm taking a look!

@jaychia jaychia added the bug Something isn't working label Jan 17, 2023
@jaychia
Copy link
Contributor

jaychia commented Jan 17, 2023

jaychia added a commit that referenced this issue Jan 17, 2023
Closes #447 

Bug introduced by
https://github.com/Eventual-Inc/Daft/pull/299/files#diff-8ce570b3f2f114483c776e449047082aaebf681b7f965f8ec989d12337a421bdR210-R214
which would skip evaluation of aliases because AliasExpressions have the
same ID as its children nodes.

Add a test and fix for this bug
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.

2 participants