Skip to content

Commit 906e5fa

Browse files
feat(spanner): un-deprecate resource name helper functions, add 3.8 tests (via synth) (#10062)
1 parent 2a86088 commit 906e5fa

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

+2-12
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
def database_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
return google.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
def instance_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
return google.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

+3-18
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
def instance_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
return google.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
def instance_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
return google.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
def project_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
return google.api_core.path_template.expand(
143128
"projects/{project}", project=project
144129
)

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

+2-12
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
def database_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
return google.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
def session_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
return google.api_core.path_template.expand(
110100
"projects/{project}/instances/{instance}/databases/{database}/sessions/{session}",
111101
project=project,

spanner/google/cloud/spanner_v1/instance.py

+1-1
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

+1-1
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
def unit(session):
9191
"""Run the unit test suite."""
9292
default(session)

0 commit comments

Comments
 (0)