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

discuss: deprecate Expr.get_name() #7762

Closed
1 task done
NickCrews opened this issue Dec 14, 2023 · 3 comments
Closed
1 task done

discuss: deprecate Expr.get_name() #7762

NickCrews opened this issue Dec 14, 2023 · 3 comments
Labels
feature Features or general enhancements

Comments

@NickCrews
Copy link
Contributor

Is your feature request related to a problem?

Inspired by #7742 (comment)

Should/how we deprecate Expr.get_name()?

I would probably vote yes? But I think it would be useful to try to list the uses of it to see if removing it would really be painful. If you have a usecase, please add it in this thread?

I use it in one place in my codebase. I have to hand off some Tables to a splink.Linker object, which expects a list of table names in the underlying DB. So all of my input tables need to be named. To do that, I rely on:

def ensure_named(t: Table, name: str | None = None) -> Table:
    if name is None:
        name = _unique_table_name()
    try:
        old_name = t.get_name()
    except AttributeError:
        pass
    if old_name == name:
        return t
    return t.alias(name)

There are other ways I could do this, using .cache() or similar. Basically, I want the semantics of

  1. need: the table must end up with a name, either as a real table or as a view
  2. need: I need to know the name of the table after that
  3. want: I can name the table as I want
  4. want: if the input table is already named in the DB, don't add another view.

Requirement #4 might be hard without .get_name(), is there some other way to tell if a table is already named in the DB?

Describe the solution you'd like

NA

What version of ibis are you running?

Na

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

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tswast
Copy link
Collaborator

tswast commented Jan 11, 2024

What's the purpose of this deprecation? We use get_name() as really one of the core functionalities of Ibis in BigQuery DataFrames.

I suppose maybe it makes less sense for table expressions, but even these can have aliases in SQL.

@jcrist
Copy link
Member

jcrist commented Jan 26, 2024

@NickCrews - how would you propose users get the underlying table name if .get_name() goes away?

@NickCrews
Copy link
Contributor Author

Yeah I think this was half-baked, we need some way to know the name. Feel free to close this

@cpcloud cpcloud closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2024
@github-project-automation github-project-automation bot moved this from backlog to done in Ibis planning and roadmap Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Archived in project
Development

No branches or pull requests

4 participants