ArangoDB-Community / pyArango

Python Driver for ArangoDB with built-in validation
https://pyarango.readthedocs.io/en/latest/
Apache License 2.0
238 stars 90 forks source link

Abnormal behavior with AQL queriy #160

Open killerB97 opened 5 years ago

killerB97 commented 5 years ago

I used a simply AQL query to match documents with a filter, when rawResults is True, I get an infinite return result. What I mean by this is when I try to iterate through the query result I get the relevant documents and infinite empty lists []. Can you help me with this?

remingtonc commented 4 years ago

Seeing this behavior off of master with AQLQuery as well.

>>> for k in db.AQLQuery(query, rawResults=True, batchSize=1):
...   for e in k:
...     print(e)
...
{<single result here>}
<hangs forever>
remingtonc commented 4 years ago

Might be related to https://github.com/ArangoDB-Community/pyArango/commit/ba114bb2c37849a897dcf6e4c74e0f8a1e684e96 ...not sure.

Hydrugion commented 4 years ago

I was able to pin down the bug and create the pull request. The bug was when getting index out of range exception, the Query object return an empty array instead of updating itself into the next batch. Calling the method nextBatch() will fix this. Thx @kqhuynguyen for debuging this with me.