Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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 spanner/google/cloud/spanner_v1/gapic/spanner_client.py
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 spanner/google/cloud/spanner_v1/instance.py
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 spanner/noxfile.py
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