Skip to content

Commit

Permalink
feat(spanner): un-deprecate resource name helper functions, add 3.8 t…
Browse files Browse the repository at this point in the history
…ests (via synth) (#10062)
  • Loading branch information
yoshi-automation committed Jan 30, 2020
1 parent cfae63d commit dbb79b0
Show file tree
Hide file tree
Showing 6 changed files with 3,742 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def database_path(cls, project, instance, database):
"""DEPRECATED. Return a fully-qualified database string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified database string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/databases/{database}",
project=project,
Expand All @@ -103,12 +98,7 @@ def database_path(cls, project, instance, database):

@classmethod
def instance_path(cls, project, instance):
"""DEPRECATED. Return a fully-qualified instance string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
project=project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def instance_path(cls, project, instance):
"""DEPRECATED. Return a fully-qualified instance string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified instance string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}",
project=project,
Expand All @@ -119,12 +114,7 @@ def instance_path(cls, project, instance):

@classmethod
def instance_config_path(cls, project, instance_config):
"""DEPRECATED. Return a fully-qualified instance_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified instance_config string."""
return google.api_core.path_template.expand(
"projects/{project}/instanceConfigs/{instance_config}",
project=project,
Expand All @@ -133,12 +123,7 @@ def instance_config_path(cls, project, instance_config):

@classmethod
def project_path(cls, project):
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)
Expand Down
14 changes: 2 additions & 12 deletions google/cloud/spanner_v1/gapic/spanner_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def database_path(cls, project, instance, database):
"""DEPRECATED. Return a fully-qualified database string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified database string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/databases/{database}",
project=project,
Expand All @@ -100,12 +95,7 @@ def database_path(cls, project, instance, database):

@classmethod
def session_path(cls, project, instance, database, session):
"""DEPRECATED. Return a fully-qualified session string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified session string."""
return google.api_core.path_template.expand(
"projects/{project}/instances/{instance}/databases/{database}/sessions/{session}",
project=project,
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner_v1/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def update(self):
instance.display_name = 'New display name'
instance.node_count = 5
before calling :meth:`update`.
before calling :meth:`update`.
:rtype: :class:`google.api_core.operation.Operation`
:returns: an operation instance
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def default(session):
)


@nox.session(python=["2.7", "3.5", "3.6", "3.7"])
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
def unit(session):
"""Run the unit test suite."""
default(session)
Expand Down
Loading

0 comments on commit dbb79b0

Please sign in to comment.