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: CLI parsing with unicode strings is erratic #4068

Closed
prrao87 opened this issue Aug 13, 2024 · 0 comments · Fixed by #4492
Closed

Bug: CLI parsing with unicode strings is erratic #4068

prrao87 opened this issue Aug 13, 2024 · 0 comments · Fixed by #4492
Assignees
Labels
bug Something isn't working cli

Comments

@prrao87
Copy link
Member

prrao87 commented Aug 13, 2024

Kùzu version

0.5.0

What operating system are you using?

macOS

What happened?

I'm noticing this inconsistent parsing behaviour between the CLI and the Python API when working with a table that has non-English characters.

CLI doesn't work

First, I create a node table for books in German:

CREATE NODE TABLE IF NOT EXISTS `B\u00fccher` (title STRING, price INT64, PRIMARY KEY (title));

Then I add a German book, referencing the table name with escaped characters

CREATE (n:`B\u00fccher` {title: 'Der Thron der Sieben Königreiche'}) SET n.price = 20;

Then I try to run a match query that directly references the table name via its unicode form, Bücher.

MATCH (n:Bücher) RETURN label(n);

I get this error:

Error: Binder exception: Table Bücher does not exist.

Python works

The same workflow when run in Python works.

import kuzu
import shutil

shutil.rmtree("test_db", ignore_errors=True)
db = kuzu.Database("test_db")
conn = kuzu.Connection(db)

# create a table
conn.execute("CREATE NODE TABLE IF NOT EXISTS `B\u00fccher` (title STRING, price INT64, PRIMARY KEY (title))")

# insert some data
conn.execute("CREATE (n:`B\u00fccher` {title: 'Der Thron der Sieben Königreiche'}) SET n.price = 20")

# Check values
res = conn.execute("MATCH (n:Bücher) RETURN label(n)")
while res.has_next():
    print(res.get_next())
['Bücher']

Are there known steps to reproduce?

See above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants