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 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[CHANGE ME] Re-generated spanner to pick up changes in the API or cli…
…ent library generator.
  • Loading branch information
yoshi-automation committed Jan 7, 2020
commit 32def80635ac1506fe1675b0394c828351514733
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 spanner/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 spanner/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