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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: samples for managing reservations #144



Copy link

@tswast tswast commented Aug 10, 2021

TODO: Testing these samples requires a capacity commitment. I created on manually on my dev project, but I think we'll want to programmatically create one in our CI project(s).

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #56 馃

@tswast tswast requested a review from as a code owner Aug 10, 2021
@tswast tswast requested a review from crwilcox Aug 10, 2021
Copy link

@snippet-bot snippet-bot bot commented Aug 10, 2021

Here is the summary of changes.

You are about to add 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

Copy link
Contributor Author

@tswast tswast commented Aug 10, 2021

args = (parent: "projects/python-docs-samples-tests/locations/US"
capacity_commitment {
  slot_count: 100
  plan: FLEX
kwargs = {'metadata': [('x-goog-request-params', 'parent=projects/python-docs-samples-tests/locations/US'), ('x-goog-api-client', 'gl-python/3.6.13 grpc/1.39.0 gax/1.31.1 gapic/1.2.2')]}

    def error_remapped_callable(*args, **kwargs):
            return callable_(*args, **kwargs)
        except grpc.RpcError as exc:
>           six.raise_from(exceptions.from_grpc_error(exc), exc)
E           google.api_core.exceptions.FailedPrecondition: 400 Google owned projects are not allowed to buy FLEX slots, please see go/bq-flex-restrictions for details.

.nox/py-3-6/lib/python3.6/site-packages/google/api_core/ FailedPrecondition
- generated xml file: /tmpfs/src/github/python-bigquery-reservation/samples/snippets/sponge_log.xml -

I've requested FLEX slot usage in internal bug 196099709

@tswast tswast requested a review from shollyman Aug 10, 2021
Copy link
Contributor Author

@tswast tswast commented Aug 12, 2021

It worked! We can now use FLEX commitments on the samples project.

@tswast tswast requested review from as code owners Aug 13, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 27b2564 into googleapis:master Aug 13, 2021
9 checks passed
@tswast tswast deleted the issue56-b195651730-update-sample branch Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants