From c238ff884d896681d0bd1312a5f531a8a42b29dc Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 16 May 2019 05:12:24 -0700 Subject: [PATCH] [CHANGE ME] Re-generated automl to pick up changes in the API or client library generator. --- .../automl_v1beta1/gapic/auto_ml_client.py | 52 +++++++------- .../cloud/automl_v1beta1/proto/io_pb2.py | 67 +++++++++++++++++-- automl/noxfile.py | 20 ++++++ automl/synth.metadata | 12 ++-- 4 files changed, 113 insertions(+), 38 deletions(-) diff --git a/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py b/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py index e672c67d3f1e..ae5eef406730 100644 --- a/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py +++ b/automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py @@ -98,12 +98,26 @@ def from_service_account_file(cls, filename, *args, **kwargs): from_service_account_json = from_service_account_file @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" + def annotation_spec_path(cls, project, location, dataset, annotation_spec): + """Return a fully-qualified annotation_spec string.""" return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", + "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}", + project=project, + location=location, + dataset=dataset, + annotation_spec=annotation_spec, + ) + + @classmethod + def column_spec_path(cls, project, location, dataset, table_spec, column_spec): + """Return a fully-qualified column_spec string.""" + return google.api_core.path_template.expand( + "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}", project=project, location=location, + dataset=dataset, + table_spec=table_spec, + column_spec=column_spec, ) @classmethod @@ -116,6 +130,15 @@ def dataset_path(cls, project, location, dataset): dataset=dataset, ) + @classmethod + def location_path(cls, project, location): + """Return a fully-qualified location string.""" + return google.api_core.path_template.expand( + "projects/{project}/locations/{location}", + project=project, + location=location, + ) + @classmethod def model_path(cls, project, location, model): """Return a fully-qualified model string.""" @@ -137,17 +160,6 @@ def model_evaluation_path(cls, project, location, model, model_evaluation): model_evaluation=model_evaluation, ) - @classmethod - def annotation_spec_path(cls, project, location, dataset, annotation_spec): - """Return a fully-qualified annotation_spec string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}", - project=project, - location=location, - dataset=dataset, - annotation_spec=annotation_spec, - ) - @classmethod def table_spec_path(cls, project, location, dataset, table_spec): """Return a fully-qualified table_spec string.""" @@ -159,18 +171,6 @@ def table_spec_path(cls, project, location, dataset, table_spec): table_spec=table_spec, ) - @classmethod - def column_spec_path(cls, project, location, dataset, table_spec, column_spec): - """Return a fully-qualified column_spec string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/datasets/{dataset}/tableSpecs/{table_spec}/columnSpecs/{column_spec}", - project=project, - location=location, - dataset=dataset, - table_spec=table_spec, - column_spec=column_spec, - ) - def __init__( self, transport=None, diff --git a/automl/google/cloud/automl_v1beta1/proto/io_pb2.py b/automl/google/cloud/automl_v1beta1/proto/io_pb2.py index d6e559efd852..3306e4518e1d 100644 --- a/automl/google/cloud/automl_v1beta1/proto/io_pb2.py +++ b/automl/google/cloud/automl_v1beta1/proto/io_pb2.py @@ -988,8 +988,43 @@ that wraps a Document proto with input\_config set. Only PDF documents are supported now, and each document may be up to 2MB large. Currently annotations on documents cannot be specified at - import. Any given .JSONL file must be 100MB or smaller. - + import. Any given .JSONL file must be 100MB or smaller. Three sample + CSV rows: TRAIN,gs://folder/file1.jsonl + VALIDATE,gs://folder/file2.jsonl TEST,gs://folder/file3.jsonl Sample + in-line JSON Lines file (presented here with artificial line breaks, + but the only actual line break is denoted by :raw-latex:`\n`).: { + "text\_snippet": { "content": "dog car cat" }, "annotations": [ { + "display\_name": "animal", "text\_extraction": { "text\_segment": + {"start\_offset": 0, "end\_offset": 2} } }, { "display\_name": + "vehicle", "text\_extraction": { "text\_segment": {"start\_offset": + 4, "end\_offset": 6} } }, { "display\_name": "animal", + "text\_extraction": { "text\_segment": {"start\_offset": 8, + "end\_offset": 10} } } ] }:raw-latex:`\n + { + "text_snippet": { + "content": "This dog is good." + }, + "annotations": [ + { + "display_name": "animal", + "text_extraction": { + "text_segment": {"start_offset": 5, "end_offset": 7} + } + } + ] + }` Sample document JSON Lines file (presented here with + artificial line breaks, but the only actual line break is denoted by + :raw-latex:`\n`).: { "document": { "input\_config": { "gcs\_source": + { "input\_uris": [ "gs://folder/document1.pdf" ] } } } + }:raw-latex:`\n + { + "document": { + "input_config": { + "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] + } + } + } + }` - For Tables: Either [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] or @@ -1126,7 +1161,29 @@ wraps a Document proto with input\_config set. Only PDF documents are supported now, and each document must be up to 2MB large. Any given .JSONL file must be 100MB or smaller, and no more than 20 files may - be given. + be given. Sample in-line JSON Lines file (presented here with + artificial line breaks, but the only actual line break is denoted by + :raw-latex:`\n`): { "id": "my\_first\_id", "text\_snippet": { + "content": "dog car cat"} }:raw-latex:`\n + { + "id": "2", + "text_snippet": { + "content": "An elaborate content", + "mime_type": "text/plain" + } + }` Sample document JSON Lines file (presented here with + artificial line breaks, but the only actual line break is denoted by + :raw-latex:`\n`).: { "document": { "input\_config": { "gcs\_source": + { "input\_uris": [ "gs://folder/document1.pdf" ] } } } + }:raw-latex:`\n + { + "document": { + "input_config": { + "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ] + } + } + } + }` - For Tables: Either [gcs\_source][google.cloud.automl.v1beta1.InputConfig.gcs\_source] or @@ -1485,9 +1542,7 @@ "docker". Under the directory given as the destination a new one with name "model-export--", where timestamp is in YYYY-MM- DDThh:mm:ss.sssZ ISO-8601 format, will be created. Inside the - model and any of its supporting files will be written, as - described `here `__. + model and any of its supporting files will be written. gcr_destination: The GCR location where model image is to be pushed to. This location may only be set for the following model formats: diff --git a/automl/noxfile.py b/automl/noxfile.py index 70d52b21bcf2..25458d299ff7 100644 --- a/automl/noxfile.py +++ b/automl/noxfile.py @@ -16,6 +16,7 @@ from __future__ import absolute_import import os +import shutil import nox @@ -138,3 +139,22 @@ def cover(session): session.run("coverage", "report", "--show-missing", "--fail-under=83") session.run("coverage", "erase") + +@nox.session(python="3.7") +def docs(session): + """Build the docs for this library.""" + + session.install('-e', '.') + session.install('sphinx', 'alabaster', 'recommonmark') + + shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) + session.run( + 'sphinx-build', + '-W', # warnings as errors + '-T', # show full traceback on exception + '-N', # no colors + '-b', 'html', + '-d', os.path.join('docs', '_build', 'doctrees', ''), + os.path.join('docs', ''), + os.path.join('docs', '_build', 'html', ''), + ) diff --git a/automl/synth.metadata b/automl/synth.metadata index 6f99e3b21a5d..b36b6c2daafb 100644 --- a/automl/synth.metadata +++ b/automl/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-04-03T01:19:38.207959Z", + "updateTime": "2019-05-16T12:12:24.753963Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.22", - "dockerImage": "googleapis/artman@sha256:e7f9554322a8aa1416c122c918fdc4cdec8cfe816f027fc948dec0be7edef320" + "version": "0.19.0", + "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e78a149f592cec6169c0de2a17f303f9f826574", - "internalRef": "241636775" + "sha": "fcf9612e65e7b4e1aee55fa07dbf028f1e3cdac6", + "internalRef": "248477824" } }, { "template": { "name": "python_library", "origin": "synthtool.gcp", - "version": "2019.2.26" + "version": "2019.5.2" } } ],