Skip to content

Adding storage.api._require_connection to allow fallback behavior. - #779

Merged
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:storage-add-require-connection
Mar 30, 2015
Merged

Adding storage.api._require_connection to allow fallback behavior.#779
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:storage-add-require-connection

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

Allows fallback in this order:

  • explicit connection
  • current batch
  • default connection
  • raise exception

Also adding Batch.current() to determine the top batch in context.

Also making storage.Batch publicly visible (reduces number of imports).

This was peeled off from #759

Allows fallback in this order:
- explicit connection
- current batch
- default connection
- raise exception
Also adding Batch.top() to determine the current batch in
context.
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 30, 2015
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling f429945 on dhermes:storage-add-require-connection into e60acb8 on GoogleCloudPlatform:master.

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

dhermes added a commit that referenced this pull request Mar 30, 2015
Adding storage.api._require_connection to allow fallback behavior.
@dhermes
dhermes merged commit 37fb0ec into googleapis:masterMar 30, 2015
@dhermes
dhermes deleted the storage-add-require-connection branch March 30, 2015 21:58
@dhermesdhermes mentioned this pull request Apr 9, 2015
parthea pushed a commit that referenced this pull request Oct 21, 2023
…-samples#779)
* Draft of first half of KMS samples
* reversed wrong change
* KMS Apiary Python samples - P1
* Few minor style issues
* Adding back in space i accidentally deleted
* Addressed all code review comments
* Renamed api directory to api-client
* Addressed more code review comments
* Formatting change
* Fix quickstart test
Change-Id: Ib79dc1345c9c40547f3fd4e9c3c9a48963a3b399
* Update readme
Change-Id: Icf4a66083f56d6f51be76ba1cf3b5dc8daf2c4c1
* Add readme
Change-Id: I2fbaa55092ef8787f1423d499aa310cab258c0c1
* Added parsers
* Final minor changes to parsers
* Added autogenerated README
* Changed snippets_test keyring name and cryptokey name
parthea added a commit that referenced this pull request Aug 21, 2025
)
* feat: Add BigQuery Metastore Partition Service API version v1alpha
PiperOrigin-RevId: 662212485
Source-Link: googleapis/googleapis@456a812
Source-Link: googleapis/googleapis-gen@2ec266e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmVjMjY2ZTZkYTAzMjA4YTc2YjBmZDYwMDFiYTdkZjkzZGFlNDRlNiJ9
chore: Update gapic-generator-python to v1.18.5
PiperOrigin-RevId: 661268868
Source-Link: googleapis/googleapis@f7d214c
Source-Link: googleapis/googleapis-gen@79a8411
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzlhODQxMWJiZGIyNWE5ODNmYTNhYWU4YzBlMTQzMjdkZjEyOWY5NCJ9
chore: Update gapic-generator-python to v1.18.4
PiperOrigin-RevId: 657207628
Source-Link: googleapis/googleapis@33fe71e
Source-Link: googleapis/googleapis-gen@e02739d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTAyNzM5ZDEyMmVkMTViZDVlZjU3NzFjNTdmMTJhODNkNDdhMWRkYSJ9
chore: Update gapic-generator-python to v1.18.3
PiperOrigin-RevId: 656040068
Source-Link: googleapis/googleapis@3f4e29a
Source-Link: googleapis/googleapis-gen@b8feb21
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhmZWIyMTA5ZGRlN2IwOTM4YzIyYzk5M2QwMDIyNTFhYzY3MTRkYyJ9
chore: Update gapic-generator-python to v1.18.3
PiperOrigin-RevId: 655567917
Source-Link: googleapis/googleapis@43aa65e
Source-Link: googleapis/googleapis-gen@0e38378
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGUzODM3ODc1MzA3NGMwZjY2ZmY2MzM0OGQ2ODY0OTI5ZTEwNGQ1YyJ9
feat(spanner): Add support for Cloud Spanner Scheduled Backups
PiperOrigin-RevId: 649277844
Source-Link: googleapis/googleapis@fd7efa2
Source-Link: googleapis/googleapis-gen@50be251
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTBiZTI1MTMyOWQ4ZGI1YjU1NTYyNmViZDQ4ODY3MjFmNTQ3ZDNjYyJ9
chore: Update gapic-generator-python to v1.18.2
PiperOrigin-RevId: 649219344
Source-Link: googleapis/googleapis@7fe35b0
Source-Link: googleapis/googleapis-gen@7a6ae64
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2E2YWU2NDQxZDFjYjA2MTBjZjhlOTgzMmI5MzgzYTRmZDUyNDIzZiJ9
chore: Update gapic-generator-python to v1.18.0
PiperOrigin-RevId: 638650618
Source-Link: googleapis/googleapis@6330f03
Source-Link: googleapis/googleapis-gen@44fa4f1
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDRmYTRmMTk3OWRjNDVjMTc3OGZkN2NhZjEzZjhlNjFjNmQxY2FlOCJ9
chore: Update gapic-generator-python to v1.17.1
PiperOrigin-RevId: 629071173
Source-Link: googleapis/googleapis@4afa392
Source-Link: googleapis/googleapis-gen@16dbbb4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZkYmJiNGQwNDU3ZGI1ZTYxYWM5Zjk5YjBkNTJhNDYxNTQ0NTVhYyJ9
* update replacements in owlbot.py
* remove v1alpha
* update owlbot config
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* fix failing unit test by mocking the correct class's method
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com>
parthea added a commit that referenced this pull request Sep 16, 2025
)
* feat: Add BigQuery Metastore Partition Service API version v1alpha
PiperOrigin-RevId: 662212485
Source-Link: googleapis/googleapis@456a812
Source-Link: googleapis/googleapis-gen@2ec266e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmVjMjY2ZTZkYTAzMjA4YTc2YjBmZDYwMDFiYTdkZjkzZGFlNDRlNiJ9
chore: Update gapic-generator-python to v1.18.5
PiperOrigin-RevId: 661268868
Source-Link: googleapis/googleapis@f7d214c
Source-Link: googleapis/googleapis-gen@79a8411
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzlhODQxMWJiZGIyNWE5ODNmYTNhYWU4YzBlMTQzMjdkZjEyOWY5NCJ9
chore: Update gapic-generator-python to v1.18.4
PiperOrigin-RevId: 657207628
Source-Link: googleapis/googleapis@33fe71e
Source-Link: googleapis/googleapis-gen@e02739d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTAyNzM5ZDEyMmVkMTViZDVlZjU3NzFjNTdmMTJhODNkNDdhMWRkYSJ9
chore: Update gapic-generator-python to v1.18.3
PiperOrigin-RevId: 656040068
Source-Link: googleapis/googleapis@3f4e29a
Source-Link: googleapis/googleapis-gen@b8feb21
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjhmZWIyMTA5ZGRlN2IwOTM4YzIyYzk5M2QwMDIyNTFhYzY3MTRkYyJ9
chore: Update gapic-generator-python to v1.18.3
PiperOrigin-RevId: 655567917
Source-Link: googleapis/googleapis@43aa65e
Source-Link: googleapis/googleapis-gen@0e38378
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGUzODM3ODc1MzA3NGMwZjY2ZmY2MzM0OGQ2ODY0OTI5ZTEwNGQ1YyJ9
feat(spanner): Add support for Cloud Spanner Scheduled Backups
PiperOrigin-RevId: 649277844
Source-Link: googleapis/googleapis@fd7efa2
Source-Link: googleapis/googleapis-gen@50be251
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTBiZTI1MTMyOWQ4ZGI1YjU1NTYyNmViZDQ4ODY3MjFmNTQ3ZDNjYyJ9
chore: Update gapic-generator-python to v1.18.2
PiperOrigin-RevId: 649219344
Source-Link: googleapis/googleapis@7fe35b0
Source-Link: googleapis/googleapis-gen@7a6ae64
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2E2YWU2NDQxZDFjYjA2MTBjZjhlOTgzMmI5MzgzYTRmZDUyNDIzZiJ9
chore: Update gapic-generator-python to v1.18.0
PiperOrigin-RevId: 638650618
Source-Link: googleapis/googleapis@6330f03
Source-Link: googleapis/googleapis-gen@44fa4f1
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDRmYTRmMTk3OWRjNDVjMTc3OGZkN2NhZjEzZjhlNjFjNmQxY2FlOCJ9
chore: Update gapic-generator-python to v1.17.1
PiperOrigin-RevId: 629071173
Source-Link: googleapis/googleapis@4afa392
Source-Link: googleapis/googleapis-gen@16dbbb4
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZkYmJiNGQwNDU3ZGI1ZTYxYWM5Zjk5YjBkNTJhNDYxNTQ0NTVhYyJ9
* update replacements in owlbot.py
* remove v1alpha
* update owlbot config
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* fix failing unit test by mocking the correct class's method
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Lingqing Gan <lingqing.gan@gmail.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
Currently, creating async clients with constructor works fine:
from google.cloud import vision
client = vision.ImageAnnotatorAsyncClient()
print(type(client))
prints: <class 'google.cloud.vision_v1.services.image_annotator.async_client.ImageAnnotatorAsyncClient'>
Using from_service_account_* methods on the other hand return sync client:
client = vision.ImageAnnotatorAsyncClient.from_service_account_file("service_account.json")
print(type(client))
This gives <class 'google.cloud.vision_v1.services.image_annotator.client.ImageAnnotatorClient'>, which is just a normal synchronous client.
This happens because these functions are linked to sync clients' methods. Now it's fixed to call the same method, but with proper class.
parthea pushed a commit that referenced this pull request Nov 24, 2025
* chore: Update gapic-generator-python to v1.11.7
PiperOrigin-RevId: 573230664
Source-Link: googleapis/googleapis@93beed3
Source-Link: googleapis/googleapis-gen@f4a4eda
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjRhNGVkYWE4MDU3NjM5ZmNmNmFkZjkxNzk4NzIyODBkMWE4ZjY1MSJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to v1.11.8
PiperOrigin-RevId: 574178735
Source-Link: googleapis/googleapis@7307199
Source-Link: googleapis/googleapis-gen@ce3af21
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2UzYWYyMWI3YzU1OWE4N2MyYmVmYzA3NmJlMGUzYWVkYTNhMjZmMCJ9
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
* chore: Update gapic-generator-python to v1.11.9
PiperOrigin-RevId: 574520922
Source-Link: googleapis/googleapis@5183984
Source-Link: googleapis/googleapis-gen@a59af19
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTU5YWYxOWQ0YWM2NTA5ZmFlZGYxY2MzOTAyOTE0MWI2YTViODk2OCJ9
* 🦉 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>
Co-authored-by: Daniel Sanche <sanche@google.com>
parthea pushed a commit that referenced this pull request Nov 26, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Mar 2, 2026
- [ ] Regenerate this pull request now.
PiperOrigin-RevId: 472561635
Source-Link: googleapis/googleapis@332ecf5
Source-Link: googleapis/googleapis-gen@4313d68
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9
parthea pushed a commit that referenced this pull request Mar 9, 2026
Ensure both referred and constrained columns reported by
`get_multi_foreign_keys` are in the same order matching the constraint
declaration. Uses information for the unique constraint corresponding
to the foreign key constraint in order to ensure its columns are
ordered correctly.
Previously, the `CONSTRAINT_COLUMN` view in the information schema was
used to retrieve the referred columns, and that view offers no
information about column order. Instead, we use the KEY_COLUMN_USAGE
view for the corresponding unique constraint, which is ordered.
This requires consulting the `REFERENTIAL_CONSTRAINTS` view in order
to find the unique constraint associated with the foreign
key. Unfortunately, this view has a [bug in the
emulator](GoogleCloudPlatform/cloud-spanner-emulator#279)
related to cross-schema foreign keys. I had to skip a test for
cross-schema foreign keys due to the emulator issue. I've confirmed a
real spanner does not have this issue.
fixes: #779
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dhermes@coveralls@tseaver@googlebot