feat: add RPC priority support#324
Conversation
larkee
left a comment
There was a problem hiding this comment.
LG overall however there is some functionality missing.
First, all commit methods should support this, including Batch.commit().
Secondly, we usually call commit on behalf of the user which means they will not be able to pass the options to the commit call themselves. This means we need to provide alternate ways of passing in the options. e.g.
database.run_in_transaction(transaction_func, request_options={"priority": "PRIORITY_LOW"})
for database.batch(request_options={"priority": "PRIORITY_MEDIUM"}) as batch:
batch.insert(table, columns, data)
Additionally, you should update the PR description to give context on the feature and how it should be used. For example, it should mention that all requests are run as PRIORITY_HIGH by default and so this feature is to deprioritize tasks.
larkee
left a comment
There was a problem hiding this comment.
Some minor docstring nits :)
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
Co-authored-by: larkee <31196561+larkee@users.noreply.github.com>
No region tags are edited in this PR.This comment is generated by snippet-bot.
|
… rpc-priority # Conflicts: # google/cloud/spanner_v1/__init__.py # tests/unit/test_transaction.py
Add client library support to enable users to optionally specify a priority level on their requests. All requests are run as
PRIORITY_HIGHby default, this allows tasks to be deprioritised.