Skip to content
Permalink
Browse files
feat(spanner): un-deprecate resource name helper functions, add 3.8 t…
…ests (via synth) (#10062)
  • Loading branch information
yoshi-automation committed Jan 30, 2020
1 parent cfae63d commit dbb79b0d8b0c79f6ed1772f28e4eedb9d986b108
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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
)
@@ -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,
@@ -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,
@@ -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
@@ -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)

0 comments on commit dbb79b0

Please sign in to comment.