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: dash in database name fails when parsing #10862

Closed
1 task done
akanz1 opened this issue Feb 19, 2025 · 3 comments · Fixed by #10863
Closed
1 task done

bug: dash in database name fails when parsing #10862

akanz1 opened this issue Feb 19, 2025 · 3 comments · Fixed by #10863
Labels
bug Incorrect behavior inside of ibis

Comments

@akanz1
Copy link
Contributor

akanz1 commented Feb 19, 2025

What happened?

When attempting to connect to a database (mssql in my case but likely irrelevant for the ticket) i get the following error.

Unable to connect to MSSQLConnector. Reason: Failed to parse 'my-dbname' into <class 'sqlglot.expressions.Table'>

Image

Following the trace leads me to a parse_one which fails when the database variable holds a string including a dash.

I can quickfix this by doing the following but lack understanding and context if this might be a problem in other places.

in L.588 (L.641 on main), backends/sql/__init__.py

table = sg.parse_one(sg.to_identifier(database, quoted=True).sql(), into=sg.exp.Table, dialect=self.dialect)

What version of ibis are you using?

ibis 9.5.0
python 3.11

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

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@akanz1 akanz1 added the bug Incorrect behavior inside of ibis label Feb 19, 2025
@cpcloud
Copy link
Member

cpcloud commented Feb 19, 2025

Thanks for the issue!

Can you show the exact code that reproduces the problem?

@cpcloud
Copy link
Member

cpcloud commented Feb 19, 2025

Hm, I think I figured out the reproducer, but the description here is a bit misleading.

It's not connecting that fails, it's calling list_tables.

@akanz1
Copy link
Contributor Author

akanz1 commented Feb 19, 2025

Thanks for the quick fix. Yes, it's the listing of tables in this case. Do you need any more information on this?

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
Archived in project
2 participants