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

[Python API] RuntimeError: Unknown parameter type <class 'uuid.UUID'> (Prepared statements) #2923

Closed
sapalli2989 opened this issue Feb 21, 2024 · 3 comments · Fixed by #2926
Assignees
Labels
apis bug Something isn't working

Comments

@sapalli2989
Copy link
Contributor

Thanks a lot for implementing native UUID types! It seems, Python API client does not support UUID in prepared statements yet?

CREATE NODE TABLE V (id UUID, PRIMARY KEY(id));
import uuid
conn.execute("CREATE (:V {id: $1});", {'1': uuid.uuid4()})

Traceback (most recent call last):
File "proj/kuzu_api.py", line 38, in execute
results = conn.execute(query, parameters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "proj/venv/lib64/python3.11/site-packages/kuzu/connection.py", line 82, in execute
_query_result = self._connection.execute(
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Unknown parameter type <class 'uuid.UUID'>

@andyfengHKU
Copy link
Contributor

Hi @sapalli2989,

thanks for reporting. I'll take a look at this issue.

Meanwhile there is a workaround to pass uuid as a string. So something along the line of

conn.execute("CREATE (:V {id: cast($1, "UUID")});", {'1': str(uuid.uuid4())})

@andyfengHKU
Copy link
Contributor

@sapalli2989 FYI, this should be fixed with PR #2926

@sapalli2989
Copy link
Contributor Author

@andyfengHKU Confirmed it works. Thanks!

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

Successfully merging a pull request may close this issue.

3 participants