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/feat: Non-Value objects error with .get_name() #10450

Open
1 task done
NickCrews opened this issue Nov 7, 2024 · 0 comments
Open
1 task done

bug/feat: Non-Value objects error with .get_name() #10450

NickCrews opened this issue Nov 7, 2024 · 0 comments
Labels
bug Incorrect behavior inside of ibis

Comments

@NickCrews
Copy link
Contributor

What happened?

Not sure what intended behavior is here, but there is a papercut: #10246 makes it sound like we expect anything with a .get_name() to actually work. But I think that all ir.Values have a name, but not all ir.Exprs do:

import ibis

t = ibis.memtable({"x": [1, 2, 3]})
t.get_name()  # ibis_pandas_memtable_2ltmalss6jcxvbo57dr753xrky
t.filter(t.x > 1).get_name()  # AttributeError: 'Filter' object has no attribute 'name'
t.union(t).get_name()  # AttributeError: 'Union' object has no attribute 'name'
t.select("x").get_name()  # AttributeError: 'Project' object has no attribute 'name'

I think there are two solutions?

  1. make ALL ir.Values be named, autogenerating one if not set explicitly, similar to ir.Values
  2. only support ir.Values being named, and move the method from ir.Expr to ir.Value, so that users don't get tab completion on this method that can sometimes fail.

Since in the above t.get_name() works, getting the name of the physical table in the backend, and I think this is useful, I would lean towards 1?

What version of ibis are you using?

main

What backend(s) are you using, if any?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NickCrews NickCrews added the bug Incorrect behavior inside of ibis label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis
Projects
Status: backlog
Development

No branches or pull requests

1 participant