Closed jlara310 closed 1 year ago
Here is the summary of changes.
This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run
label or use the checkbox below:
We discussed this offline, but please see if you can modify the index as part of the test setup
Let me know if you need any help with this
@daniel-sanche
I added a test fixture to set up indexes but it's getting a permission error:
google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission
@daniel-sanche
I added a test fixture to set up indexes but it's getting a permission error:
google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission
Hmm, that's strange, because the service account has IndexAdmin
permissions. And I can also see an audit log that looks like the operation was successful, and I see an index that looks like the one you created on datastore
I wonder what would happen if you removed the result()
from admin_client.create_index(request).result()
? It looks like it uses a separate rpc to get the operation status, I wonder if it's possible that is the one that is raising 403?
Or you could try catching the error to silence it for now, to see if the index you need was created properly
You're right. The IndexAdmin role does not have permissions for operations. Removed the code that tries to wait for the operation.
Only the Python 3.10 test failed. Perhaps the IndexAdmin role is missing for that project?
thanks, I opened a request to add the missing permission to that project
@jlara310 Ok, the permissions have been added and the tests are now passing!
Add sample snippets for sum and avg aggregation queries.
Two of these snippets depend on the following index:
indexes:
I added samples/snippets/index.yaml to track the indexes required for the samples.
Fixes #479 🦕