Skip to content

Commit

Permalink
Fix synth replace to add TablesClient. (#9033)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Aug 15, 2019
1 parent b9fc60e commit 0cb7b14
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
6 changes: 3 additions & 3 deletions packages/google-cloud-automl/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"updateTime": "2019-08-10T12:12:23.946735Z",
"updateTime": "2019-08-15T16:50:20.093543Z",
"sources": [
{
"generator": {
Expand All @@ -12,8 +12,8 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "2a2c5518f64010c4e458afc818e57ed24fecdf6d",
"internalRef": "262646243"
"sha": "3406d1e899f1f41123b3fa9210ad4bef25c9a720",
"internalRef": "263234709"
}
},
{
Expand Down
38 changes: 22 additions & 16 deletions packages/google-cloud-automl/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,33 @@
s.move(library / f"tests/unit/gapic/{version}")
s.move(library / f"docs/gapic/{version}")

s.replace(
f"google/cloud/automl_{version}/__init__.py",
f"from google.cloud.automl_v1beta1.gapic import prediction_service_client",
f"from google.cloud.automl_v1beta1.gapic import prediction_service_client"
f"from google.cloud.automl_v1beta1.tables import tables_client"
f"\n\n"
f"class TablesClient(tables_client.TablesClient):"
f" __doc__ = tables_client.TablesClient.__doc__"
)

s.replace(
f"google/cloud/automl_{version}/__init__.py",
f"__all__ = (\"enums\", \"types\", \"AutoMlClient\", \"PredictionServiceClient\")",
f"__all__ = (\"enums\", \"types\", \"AutoMlClient\", \"PredictionServiceClient\", \"TablesClient\")"
)

s.move(library / f"docs/conf.py")

# Use the highest version library to generate import alias.
s.move(library / "google/cloud/automl.py")

# Add tables client to v1beta1
s.replace(
f"google/cloud/automl_v1beta1/__init__.py",
f"from google.cloud.automl_v1beta1.gapic import prediction_service_client",
f"from google.cloud.automl_v1beta1.gapic import prediction_service_client\n"
f"from google.cloud.automl_v1beta1.tables import tables_client"
f"\n\n"
f"class TablesClient(tables_client.TablesClient):"
f" __doc__ = tables_client.TablesClient.__doc__"
)

s.replace(
f"google/cloud/automl_v1beta1/__init__.py",
f"""__all__ = \(
'enums',
'types',
'AutoMlClient',
'PredictionServiceClient',
\)""",
f"__all__ = (\"enums\", \"types\", \"AutoMlClient\", \"PredictionServiceClient\", \"TablesClient\")"
)

# Fixup issues in generated code
s.replace(
"**/gapic/*_client.py",
Expand Down

0 comments on commit 0cb7b14

Please sign in to comment.