-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Storage: updating Connection docstring; turning make_request private. #604
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: updating Connection docstring; turning make_request private. #604
Conversation
Making it clear in the docstring that the Connection itself only handles "bucket" queries and that the other classes handle the other 30 (give or take) methods of the API.
|
LGTM |
Storage: updating Connection docstring; turning make_request private.
|
@tseaver WDYT of missing support / overlapping support of |
|
I think we should remove the single-bucket-centric connection methods, and surface such operations only on
|
|
I like it! In the implicit case, WDYT of: >>> b = Bucket(bucket_name)
>>> b.exists()
False
>>> b.create()
>>> b.exists()
True |
|
In line with this would be putting most of the This leaves us storage.set_default_connection()
buckets = storage.get_all_buckets()
bucket = buckets.next() # Iterator
for blob in bucket.get_all_blobs():
do_something(blob)or even in the more extreme scenario that there is a default bucket storage.set_defaults()
for blob in storage.get_all_blobs():
do_something(blob) |
|
I like I'm not sure about calling ISTM that |
* feat: Add support for python 3.11 chore: Update gapic-generator-python to v1.8.0 PiperOrigin-RevId: 500768693 Source-Link: googleapis/googleapis@190b612 Source-Link: googleapis/googleapis-gen@7bf29a4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2JmMjlhNDE0YjllY2FjMzE3MGYwYjY1YmRjMmE5NTcwNWMwZWYxYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Cross-references like `~.ImageAnnotatorClient` don't always work correctly with sphinx. This PR changes the `sphinx()` method to always produce a full path like `google.cloud.vision_v1.ImageAnnotatorClient`. Also some other smaller changes: - Generate a separate `.rst` page for each service, which improves readability for APIs that have (1) a lot of services or (2) a lot of methods in a service. `services.rst` acts as an index page instead. - Add pagers to the generated docs - Use `undoc-members` to list enum attributes in generated docs (fixes #625) - Add newlines after bulleted lists by removing `nl=False`. Fixes #604 - Add a 'docs' session to the templated `noxfile.py` so folks using the self-service model can have generated docs. - Fix reference to LRO result type in `Returns:` - Fix `{@api.name}` reference in the `from_service_account..`. methods to reference the client type instead - Remove `:class:` notation when specifying types for attributes (sphinx doesn't need it to create a link)
🤖 I have created a release \*beep\* \*boop\* --- ## [0.39.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.38.0...v0.39.0) (2020-12-22) ### Features * allow warehouse name to be customized ([#717](https://www.github.com/googleapis/gapic-generator-python/issues/717)) ([7c185e8](https://www.github.com/googleapis/gapic-generator-python/commit/7c185e87cb4252b1f99ed121515814595f9492c4)), closes [#605](https://www.github.com/googleapis/gapic-generator-python/issues/605) ### Bug Fixes * fix sphinx identifiers ([#714](https://www.github.com/googleapis/gapic-generator-python/issues/714)) ([39be474](https://www.github.com/googleapis/gapic-generator-python/commit/39be474b4419dfa521ef51927fd36dbf257d68e3)), closes [#625](https://www.github.com/googleapis/gapic-generator-python/issues/625) [#604](https://www.github.com/googleapis/gapic-generator-python/issues/604) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please).
* fix: resolve issue handling protobuf responses in rest streaming * raise ValueError if response_message_cls is not a subclass of proto.Message or google.protobuf.message.Message * remove response_type from pytest.mark.parametrize * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add test for ValueError in response_iterator._grab() --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@8767740 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:023a21377a2a00008057f99f0118edadc30a19d1636a3fee47189ebec2f3921c Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Making it clear in the docstring that the Connection itself only handles
storage.bucket...API methods and that the other classes handle the other 30 (give or take) methods of the API.@tseaver This documents our decision from earlier today (about the responsibilities of
Connection).Also note
storage.buckets.updateanywhere (butConnection.api_requestwould allow it)storage.buckets.patchonConnection. Only viaBucket(through_PropertyMixin._patch_properties()).Bucket._reload_properties()(via_PropertyMixin) andConnection.get_bucketimplementstorage.buckets.get.For your reference: discovery document.