Skip to content

Commit eb36e8a

Browse files
feat(spanner): [Many APIs] Add support for Cloud Spanner Scheduled Backups (#12872)
BEGIN_COMMIT_OVERRIDE feat(spanner): Add support for Cloud Spanner Scheduled Backups END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. PiperOrigin-RevId: 649277844 Source-Link: googleapis/googleapis@fd7efa2 Source-Link: googleapis/googleapis-gen@50be251 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LW5vdGlmaWNhdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjUwYmUyNTEzMjlkOGRiNWI1NTU2MjZlYmQ0ODg2NzIxZjU0N2QzY2MifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LXByb2R1Y3RzLy5Pd2xCb3QueWFtbCIsImgiOiI1MGJlMjUxMzI5ZDhkYjViNTU1NjI2ZWJkNDg4NjcyMWY1NDdkM2NjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LXByb21vdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjUwYmUyNTEzMjlkOGRiNWI1NTU2MjZlYmQ0ODg2NzIxZjU0N2QzY2MifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LXF1b3RhLy5Pd2xCb3QueWFtbCIsImgiOiI1MGJlMjUxMzI5ZDhkYjViNTU1NjI2ZWJkNDg4NjcyMWY1NDdkM2NjIn0= Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LXJlcG9ydHMvLk93bEJvdC55YW1sIiwiaCI6IjUwYmUyNTEzMjlkOGRiNWI1NTU2MjZlYmQ0ODg2NzIxZjU0N2QzY2MifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLXR5cGUvLk93bEJvdC55YW1sIiwiaCI6IjUwYmUyNTEzMjlkOGRiNWI1NTU2MjZlYmQ0ODg2NzIxZjU0N2QzY2MifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiNTBiZTI1MTMyOWQ4ZGI1YjU1NTYyNmViZDQ4ODY3MjFmNTQ3ZDNjYyJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent 04ec204 commit eb36e8a

54 files changed

Lines changed: 341 additions & 285 deletions

File tree

Some content is hidden

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

packages/google-shopping-merchant-notifications/google/shopping/merchant_notifications_v1beta/services/notifications_api_service/transports/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def __init__(
8484

8585
# Save the scopes.
8686
self._scopes = scopes
87+
if not hasattr(self, "_ignore_credentials"):
88+
self._ignore_credentials: bool = False
8789

8890
# If no credentials are provided, then determine the appropriate
8991
# defaults.
@@ -96,7 +98,7 @@ def __init__(
9698
credentials, _ = google.auth.load_credentials_from_file(
9799
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
98100
)
99-
elif credentials is None:
101+
elif credentials is None and not self._ignore_credentials:
100102
credentials, _ = google.auth.default(
101103
**scopes_kwargs, quota_project_id=quota_project_id
102104
)

packages/google-shopping-merchant-notifications/google/shopping/merchant_notifications_v1beta/services/notifications_api_service/transports/grpc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def __init__(
122122

123123
if isinstance(channel, grpc.Channel):
124124
# Ignore credentials if a channel was passed.
125-
credentials = False
125+
credentials = None
126+
self._ignore_credentials = True
126127
# If a channel was explicitly provided, set it.
127128
self._grpc_channel = channel
128129
self._ssl_channel_credentials = None

packages/google-shopping-merchant-notifications/google/shopping/merchant_notifications_v1beta/services/notifications_api_service/transports/grpc_asyncio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def __init__(
169169

170170
if isinstance(channel, aio.Channel):
171171
# Ignore credentials if a channel was passed.
172-
credentials = False
172+
credentials = None
173+
self._ignore_credentials = True
173174
# If a channel was explicitly provided, set it.
174175
self._grpc_channel = channel
175176
self._ssl_channel_credentials = None

packages/google-shopping-merchant-notifications/noxfile.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,28 @@ def install_unittest_dependencies(session, *constraints):
160160
session.install("-e", ".", *constraints)
161161

162162

163-
def default(session):
163+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
164+
@nox.parametrize(
165+
"protobuf_implementation",
166+
["python", "upb", "cpp"],
167+
)
168+
def unit(session, protobuf_implementation):
164169
# Install all test dependencies, then install this package in-place.
165170

171+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
172+
session.skip("cpp implementation is not supported in python 3.11+")
173+
166174
constraints_path = str(
167175
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
168176
)
169177
install_unittest_dependencies(session, "-c", constraints_path)
170178

179+
# TODO(https://github.com/googleapis/synthtool/issues/1976):
180+
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
181+
# The 'cpp' implementation requires Protobuf<4.
182+
if protobuf_implementation == "cpp":
183+
session.install("protobuf<4")
184+
171185
# Run py.test against the unit tests.
172186
session.run(
173187
"py.test",
@@ -181,15 +195,12 @@ def default(session):
181195
"--cov-fail-under=0",
182196
os.path.join("tests", "unit"),
183197
*session.posargs,
198+
env={
199+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
200+
},
184201
)
185202

186203

187-
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
188-
def unit(session):
189-
"""Run the unit test suite."""
190-
default(session)
191-
192-
193204
def install_systemtest_dependencies(session, *constraints):
194205
# Use pre-release gRPC for system tests.
195206
# Exclude version 1.52.0rc1 which has a known issue.
@@ -358,9 +369,16 @@ def docfx(session):
358369

359370

360371
@nox.session(python="3.12")
361-
def prerelease_deps(session):
372+
@nox.parametrize(
373+
"protobuf_implementation",
374+
["python", "upb", "cpp"],
375+
)
376+
def prerelease_deps(session, protobuf_implementation):
362377
"""Run all tests with prerelease versions of dependencies installed."""
363378

379+
if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
380+
session.skip("cpp implementation is not supported in python 3.11+")
381+
364382
# Install all dependencies
365383
session.install("-e", ".[all, tests, tracing]")
366384
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
@@ -397,9 +415,9 @@ def prerelease_deps(session):
397415
"protobuf",
398416
# dependency of grpc
399417
"six",
418+
"grpc-google-iam-v1",
400419
"googleapis-common-protos",
401-
# Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
402-
"grpcio!=1.52.0rc1",
420+
"grpcio",
403421
"grpcio-status",
404422
"google-api-core",
405423
"google-auth",
@@ -425,4 +443,10 @@ def prerelease_deps(session):
425443
session.run("python", "-c", "import grpc; print(grpc.__version__)")
426444
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")
427445

428-
session.run("py.test", "tests/unit")
446+
session.run(
447+
"py.test",
448+
"tests/unit",
449+
env={
450+
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
451+
},
452+
)

packages/google-shopping-merchant-notifications/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# See https://github.com/googleapis/google-cloud-python/issues/12364
4949
"google-auth >= 2.14.1, <3.0.0dev,!=2.24.0,!=2.25.0",
5050
"proto-plus >= 1.22.3, <2.0.0dev",
51-
"protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
51+
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
5252
"google-shopping-type >= 0.1.0, <1.0.0dev",
5353
]
5454
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-shopping-merchant-notifications"

packages/google-shopping-merchant-notifications/testing/constraints-3.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
google-api-core==1.34.1
88
google-auth==2.14.1
99
proto-plus==1.22.3
10-
protobuf==3.19.5
10+
protobuf==3.20.2
1111
google-shopping-type==0.1.0

packages/google-shopping-merchant-notifications/tests/unit/gapic/merchant_notifications_v1beta/test_notifications_api_service.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,12 +1376,7 @@ async def test_get_notification_subscription_async_use_cached_wrapped_rpc(
13761376
)
13771377

13781378
# Replace cached wrapped function with mock
1379-
class AwaitableMock(mock.AsyncMock):
1380-
def __await__(self):
1381-
self.await_count += 1
1382-
return iter([])
1383-
1384-
mock_object = AwaitableMock()
1379+
mock_object = mock.AsyncMock()
13851380
client._client._transport._wrapped_methods[
13861381
client._client._transport.get_notification_subscription
13871382
] = mock_object
@@ -1786,12 +1781,7 @@ async def test_create_notification_subscription_async_use_cached_wrapped_rpc(
17861781
)
17871782

17881783
# Replace cached wrapped function with mock
1789-
class AwaitableMock(mock.AsyncMock):
1790-
def __await__(self):
1791-
self.await_count += 1
1792-
return iter([])
1793-
1794-
mock_object = AwaitableMock()
1784+
mock_object = mock.AsyncMock()
17951785
client._client._transport._wrapped_methods[
17961786
client._client._transport.create_notification_subscription
17971787
] = mock_object
@@ -2210,12 +2200,7 @@ async def test_update_notification_subscription_async_use_cached_wrapped_rpc(
22102200
)
22112201

22122202
# Replace cached wrapped function with mock
2213-
class AwaitableMock(mock.AsyncMock):
2214-
def __await__(self):
2215-
self.await_count += 1
2216-
return iter([])
2217-
2218-
mock_object = AwaitableMock()
2203+
mock_object = mock.AsyncMock()
22192204
client._client._transport._wrapped_methods[
22202205
client._client._transport.update_notification_subscription
22212206
] = mock_object
@@ -2621,12 +2606,7 @@ async def test_delete_notification_subscription_async_use_cached_wrapped_rpc(
26212606
)
26222607

26232608
# Replace cached wrapped function with mock
2624-
class AwaitableMock(mock.AsyncMock):
2625-
def __await__(self):
2626-
self.await_count += 1
2627-
return iter([])
2628-
2629-
mock_object = AwaitableMock()
2609+
mock_object = mock.AsyncMock()
26302610
client._client._transport._wrapped_methods[
26312611
client._client._transport.delete_notification_subscription
26322612
] = mock_object
@@ -3007,12 +2987,7 @@ async def test_list_notification_subscriptions_async_use_cached_wrapped_rpc(
30072987
)
30082988

30092989
# Replace cached wrapped function with mock
3010-
class AwaitableMock(mock.AsyncMock):
3011-
def __await__(self):
3012-
self.await_count += 1
3013-
return iter([])
3014-
3015-
mock_object = AwaitableMock()
2990+
mock_object = mock.AsyncMock()
30162991
client._client._transport._wrapped_methods[
30172992
client._client._transport.list_notification_subscriptions
30182993
] = mock_object

packages/google-shopping-merchant-products/google/shopping/merchant_products/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.1.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-shopping-merchant-products/google/shopping/merchant_products_v1beta/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.1.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-shopping-merchant-products/google/shopping/merchant_products_v1beta/services/product_inputs_service/transports/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def __init__(
8282

8383
# Save the scopes.
8484
self._scopes = scopes
85+
if not hasattr(self, "_ignore_credentials"):
86+
self._ignore_credentials: bool = False
8587

8688
# If no credentials are provided, then determine the appropriate
8789
# defaults.
@@ -94,7 +96,7 @@ def __init__(
9496
credentials, _ = google.auth.load_credentials_from_file(
9597
credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
9698
)
97-
elif credentials is None:
99+
elif credentials is None and not self._ignore_credentials:
98100
credentials, _ = google.auth.default(
99101
**scopes_kwargs, quota_project_id=quota_project_id
100102
)

0 commit comments

Comments
 (0)