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

RuntimeError: Unknown parameter type <class 'NoneType'> (Prepared statement, Python API) #2983

Closed
sapalli2989 opened this issue Mar 2, 2024 · 1 comment

Comments

@sapalli2989
Copy link
Contributor

sapalli2989 commented Mar 2, 2024

import kuzu

conn = kuzu.Connection(kuzu.Database("/tmp/db"))
conn.execute("CREATE NODE TABLE V(id STRING,PRIMARY KEY(id));")
conn.execute("CREATE (v:V {id: 'foo'}) RETURN v;")
conn.execute("MATCH (v:V {id: $1}) RETURN v;", {"1": "foo"})  # works
conn.execute("MATCH (v:V {id: $1}) RETURN v;", {"1": None})  # below error

Traceback (most recent call last):
File "/tmp/test1/main.py", line 14, in
conn.execute("MATCH (v:V {id: $1}) RETURN v;", {"1": None})
File "/tmp/test1/.venv/lib64/python3.12/site-packages/kuzu/connection.py", line 82, in execute
_query_result = self._connection.execute(
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Unknown parameter type <class 'NoneType'>

In addition to UUID: please allow None in prepared statements of Python API mapping. This is useful for:

  • passing dynamic, intermediate (a.k.a. Maybe) values to prepared statement
  • None/NULL values are sometimes needed within Cypher statement logic
  • MATCH (v:V {id: NULL}) RETURN v; works as well
@andyfengHKU
Copy link
Contributor

#3098 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants