Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit906e5fa

Browse files
feat(spanner): un-deprecate resource name helper functions, add 3.8 tests (via synth) (#10062)
1 parent2a86088 commit906e5fa

File tree

6 files changed

+3742
-49
lines changed

6 files changed

+3742
-49
lines changed

‎spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8888

8989
@classmethod
9090
defdatabase_path(cls,project,instance,database):
91-
"""DEPRECATED. Return a fully-qualified database string."""
92-
warnings.warn(
93-
"Resource name helper functions are deprecated.",
94-
PendingDeprecationWarning,
95-
stacklevel=1,
96-
)
91+
"""Return a fully-qualified database string."""
9792
returngoogle.api_core.path_template.expand(
9893
"projects/{project}/instances/{instance}/databases/{database}",
9994
project=project,
@@ -103,12 +98,7 @@ def database_path(cls, project, instance, database):
10398

10499
@classmethod
105100
definstance_path(cls,project,instance):
106-
"""DEPRECATED. Return a fully-qualified instance string."""
107-
warnings.warn(
108-
"Resource name helper functions are deprecated.",
109-
PendingDeprecationWarning,
110-
stacklevel=1,
111-
)
101+
"""Return a fully-qualified instance string."""
112102
returngoogle.api_core.path_template.expand(
113103
"projects/{project}/instances/{instance}",
114104
project=project,

‎spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
105105

106106
@classmethod
107107
definstance_path(cls,project,instance):
108-
"""DEPRECATED. Return a fully-qualified instance string."""
109-
warnings.warn(
110-
"Resource name helper functions are deprecated.",
111-
PendingDeprecationWarning,
112-
stacklevel=1,
113-
)
108+
"""Return a fully-qualified instance string."""
114109
returngoogle.api_core.path_template.expand(
115110
"projects/{project}/instances/{instance}",
116111
project=project,
@@ -119,12 +114,7 @@ def instance_path(cls, project, instance):
119114

120115
@classmethod
121116
definstance_config_path(cls,project,instance_config):
122-
"""DEPRECATED. Return a fully-qualified instance_config string."""
123-
warnings.warn(
124-
"Resource name helper functions are deprecated.",
125-
PendingDeprecationWarning,
126-
stacklevel=1,
127-
)
117+
"""Return a fully-qualified instance_config string."""
128118
returngoogle.api_core.path_template.expand(
129119
"projects/{project}/instanceConfigs/{instance_config}",
130120
project=project,
@@ -133,12 +123,7 @@ def instance_config_path(cls, project, instance_config):
133123

134124
@classmethod
135125
defproject_path(cls,project):
136-
"""DEPRECATED. Return a fully-qualified project string."""
137-
warnings.warn(
138-
"Resource name helper functions are deprecated.",
139-
PendingDeprecationWarning,
140-
stacklevel=1,
141-
)
126+
"""Return a fully-qualified project string."""
142127
returngoogle.api_core.path_template.expand(
143128
"projects/{project}",project=project
144129
)

‎spanner/google/cloud/spanner_v1/gapic/spanner_client.py‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8585

8686
@classmethod
8787
defdatabase_path(cls,project,instance,database):
88-
"""DEPRECATED. Return a fully-qualified database string."""
89-
warnings.warn(
90-
"Resource name helper functions are deprecated.",
91-
PendingDeprecationWarning,
92-
stacklevel=1,
93-
)
88+
"""Return a fully-qualified database string."""
9489
returngoogle.api_core.path_template.expand(
9590
"projects/{project}/instances/{instance}/databases/{database}",
9691
project=project,
@@ -100,12 +95,7 @@ def database_path(cls, project, instance, database):
10095

10196
@classmethod
10297
defsession_path(cls,project,instance,database,session):
103-
"""DEPRECATED. Return a fully-qualified session string."""
104-
warnings.warn(
105-
"Resource name helper functions are deprecated.",
106-
PendingDeprecationWarning,
107-
stacklevel=1,
108-
)
98+
"""Return a fully-qualified session string."""
10999
returngoogle.api_core.path_template.expand(
110100
"projects/{project}/instances/{instance}/databases/{database}/sessions/{session}",
111101
project=project,

‎spanner/google/cloud/spanner_v1/instance.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def update(self):
270270
instance.display_name = 'New display name'
271271
instance.node_count = 5
272272
273-
before calling :meth:`update`.
273+
before calling :meth:`update`.
274274
275275
:rtype: :class:`google.api_core.operation.Operation`
276276
:returns: an operation instance

‎spanner/noxfile.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def default(session):
8686
)
8787

8888

89-
@nox.session(python=["2.7","3.5","3.6","3.7"])
89+
@nox.session(python=["2.7","3.5","3.6","3.7","3.8"])
9090
defunit(session):
9191
"""Run the unit test suite."""
9292
default(session)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp