Cursor in QueryLambda

Any plans to make QueryLambda.execute() return a cursor in the Python rockset API? I see there is a TODO for this in the source code. I would love for this to be implemented, as right now I cannot paginate results from a Query Lambda afaict.

Thanks!

1 Like

Hi @suo ,

Thanks for your comment and product feedback. I’ve filed an issue with our product engineering to add this.

In the meantime, here’s a CURL example that works by passing the paginate flag. You’ll have to make an HTTP POST request using the request library in Python.

curl --request POST \
--url https://api.rs2.usw2.rockset.com/v1/orgs/self/ws/commons/lambdas/YOURlambda/tags/latest \
-H "Authorization: ApiKey YOURAPIKEY" \
-H 'Content-Type: application/json' \
-d '{
"parameters": [
{
"name": "num",
"type": "int",
"value": "1000"
}
],
"paginate":true,
"initial_paginate_response_doc_count":500
}' \
| python -m json.tool

Please let me know if this workaround helps you for the time being. As soon as pagination is compatible with query lambdas, I can update here.

Best,
n

1 Like

Thanks for the example! Would be nice to have direct support in the Python API as well. Looking forward to hearing from the team.

1 Like