Content-Length: 2257955 | pFad | https://github.com/googleapis/google-cloud-python/commit/9aa301ae6ca3080cae286a19de9cdc1b796ab37d

F8 fix: Add async context manager return types (#11444) · googleapis/google-cloud-python@9aa301a · GitHub
Skip to content

Commit 9aa301a

Browse files
fix: Add async context manager return types (#11444)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 98bddda commit 9aa301a

File tree

532 files changed

+51479
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+51479
-484
lines changed

packages/google-ai-generativelanguage/google/ai/generativelanguage/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/discuss_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ async def sample_count_message_tokens():
528528
# Done; return the response.
529529
return response
530530

531-
async def __aenter__(self):
531+
async def __aenter__(self) -> "DiscussServiceAsyncClient":
532532
return self
533533

534534
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/model_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ async def sample_list_models():
446446
# Done; return the response.
447447
return response
448448

449-
async def __aenter__(self):
449+
async def __aenter__(self) -> "ModelServiceAsyncClient":
450450
return self
451451

452452
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/google/ai/generativelanguage_v1beta2/services/text_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ async def sample_embed_text():
537537
# Done; return the response.
538538
return response
539539

540-
async def __aenter__(self):
540+
async def __aenter__(self) -> "TextServiceAsyncClient":
541541
return self
542542

543543
async def __aexit__(self, exc_type, exc, tb):

packages/google-ai-generativelanguage/samples/generated_samples/snippet_metadata_google.ai.generativelanguage.v1beta2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-ai-generativelanguage",
11-
"version": "0.3.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-ai-generativelanguage/tests/unit/gapic/generativelanguage_v1beta2/test_model_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,9 +1319,11 @@ async def test_list_models_async_pages():
13191319
RuntimeError,
13201320
)
13211321
pages = []
1322-
async for page_ in (
1322+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
1323+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
1324+
async for page_ in ( # pragma: no branch
13231325
await client.list_models(request={})
1324-
).pages: # pragma: no branch
1326+
).pages:
13251327
pages.append(page_)
13261328
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
13271329
assert page_.raw_page.next_page_token == token

packages/google-apps-script-type/CONTRIBUTING.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
239239
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
240240

241241

242-
We also explicitly decided to support Python 3 beginning with version 3.7.
243-
Reasons for this include:
244-
245-
- Encouraging use of newest versions of Python 3
246-
- Taking the lead of `prominent`_ open-source `projects`_
247-
- `Unicode literal support`_ which allows for a cleaner codebase that
248-
works in both Python 2 and Python 3
249-
250-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
251-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
252-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
253-
254242
**********
255243
Versioning
256244
**********

packages/google-apps-script-type/google/apps/script/type/calendar/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/docs/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/drive/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/gmail/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/sheets/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/google/apps/script/type/slides/gapic_version.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
17-
__version__ = "0.3.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-apps-script-type/noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,9 @@ def docfx(session):
305305

306306
session.install("-e", ".")
307307
session.install(
308-
"sphinx==4.0.1",
308+
"gcp-sphinx-docfx-yaml",
309309
"alabaster",
310310
"recommonmark",
311-
"gcp-sphinx-docfx-yaml",
312311
)
313312

314313
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)

packages/google-apps-script-type/testing/constraints-3.10.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
google-apps-script-type

packages/google-apps-script-type/testing/constraints-3.11.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
google-apps-script-type

packages/google-apps-script-type/testing/constraints-3.12.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
google-apps-script-type

packages/google-apps-script-type/testing/constraints-3.8.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
google-apps-script-type

packages/google-apps-script-type/testing/constraints-3.9.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
google-api-core
55
proto-plus
66
protobuf
7+
google-apps-script-type

packages/google-area120-tables/google/area120/tables/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.11.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-area120-tables/google/area120/tables_v1alpha1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.11.2" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-area120-tables/google/area120/tables_v1alpha1/services/tables_service/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ async def sample_batch_delete_rows():
13641364
metadata=metadata,
13651365
)
13661366

1367-
async def __aenter__(self):
1367+
async def __aenter__(self) -> "TablesServiceAsyncClient":
13681368
return self
13691369

13701370
async def __aexit__(self, exc_type, exc, tb):

packages/google-area120-tables/noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,9 @@ def docfx(session):
305305

306306
session.install("-e", ".")
307307
session.install(
308-
"sphinx==4.0.1",
308+
"gcp-sphinx-docfx-yaml",
309309
"alabaster",
310310
"recommonmark",
311-
"gcp-sphinx-docfx-yaml",
312311
)
313312

314313
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchCreateRows
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-area120-tables
24+
25+
26+
# [START area120tables_v1alpha1_generated_TablesService_BatchCreateRows_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.area120 import tables_v1alpha1
35+
36+
37+
async def sample_batch_create_rows():
38+
# Create a client
39+
client = tables_v1alpha1.TablesServiceAsyncClient()
40+
41+
# Initialize request argument(s)
42+
requests = tables_v1alpha1.CreateRowRequest()
43+
requests.parent = "parent_value"
44+
45+
request = tables_v1alpha1.BatchCreateRowsRequest(
46+
parent="parent_value",
47+
requests=requests,
48+
)
49+
50+
# Make the request
51+
response = await client.batch_create_rows(request=request)
52+
53+
# Handle the response
54+
print(response)
55+
56+
# [END area120tables_v1alpha1_generated_TablesService_BatchCreateRows_async]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchCreateRows
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-area120-tables
24+
25+
26+
# [START area120tables_v1alpha1_generated_TablesService_BatchCreateRows_sync]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.area120 import tables_v1alpha1
35+
36+
37+
def sample_batch_create_rows():
38+
# Create a client
39+
client = tables_v1alpha1.TablesServiceClient()
40+
41+
# Initialize request argument(s)
42+
requests = tables_v1alpha1.CreateRowRequest()
43+
requests.parent = "parent_value"
44+
45+
request = tables_v1alpha1.BatchCreateRowsRequest(
46+
parent="parent_value",
47+
requests=requests,
48+
)
49+
50+
# Make the request
51+
response = client.batch_create_rows(request=request)
52+
53+
# Handle the response
54+
print(response)
55+
56+
# [END area120tables_v1alpha1_generated_TablesService_BatchCreateRows_sync]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# Generated code. DO NOT EDIT!
17+
#
18+
# Snippet for BatchDeleteRows
19+
# NOTE: This snippet has been automatically generated for illustrative purposes only.
20+
# It may require modifications to work in your environment.
21+
22+
# To install the latest published package dependency, execute the following:
23+
# python3 -m pip install google-area120-tables
24+
25+
26+
# [START area120tables_v1alpha1_generated_TablesService_BatchDeleteRows_async]
27+
# This snippet has been automatically generated and should be regarded as a
28+
# code template only.
29+
# It will require modifications to work:
30+
# - It may require correct/in-range values for request initialization.
31+
# - It may require specifying regional endpoints when creating the service
32+
# client as shown in:
33+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
34+
from google.area120 import tables_v1alpha1
35+
36+
37+
async def sample_batch_delete_rows():
38+
# Create a client
39+
client = tables_v1alpha1.TablesServiceAsyncClient()
40+
41+
# Initialize request argument(s)
42+
request = tables_v1alpha1.BatchDeleteRowsRequest(
43+
parent="parent_value",
44+
names=['names_value1', 'names_value2'],
45+
)
46+
47+
# Make the request
48+
await client.batch_delete_rows(request=request)
49+
50+
51+
# [END area120tables_v1alpha1_generated_TablesService_BatchDeleteRows_async]

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/google-cloud-python/commit/9aa301ae6ca3080cae286a19de9cdc1b796ab37d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy