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 get_as_df() returns incorrect result when being called for more than once #1173

Closed
mewim opened this issue Jan 12, 2023 · 0 comments · Fixed by #1192
Closed

Python API get_as_df() returns incorrect result when being called for more than once #1173

mewim opened this issue Jan 12, 2023 · 0 comments · Fixed by #1192

Comments

@mewim
Copy link
Member

mewim commented Jan 12, 2023

Steps to reproduce:

import kuzu
db = kuzu.Database("test")
conn = kuzu.Connection(db)
conn.execute("CREATE NODE TABLE person (ID INT64, fName STRING, gender INT64, isStudent BOOLEAN, isWorker BOOLEAN, "
             "age INT64, eyeSight DOUBLE, birthdate DATE, registerTime TIMESTAMP, lastJobDuration "
             "INTERVAL, workedHours INT64[], usedNames STRING[], courseScoresPerTerm INT64[][], PRIMARY "
             "KEY (ID))")
conn.execute('COPY person FROM "dataset/tinysnb/vPerson.csv" (HEADER=true)')
res = conn.execute("MATCH (p:person) RETURN p.fName")

res.get_as_df()
# returns correct result

res.get_as_df()
# returns all None or garbage

This is likely due to that there are no more tuples in QueryResult, but the get_as_df method still keeps reading. We should either throw an error in this case or allow jumping to the beginning of the QueryResult again.

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

Successfully merging a pull request may close this issue.

1 participant