Skip to content

Commit

Permalink
AutoML: Add a TablesClient for automl-tables specific behavior. (#8720)
Browse files Browse the repository at this point in the history
* Checking in staged client helper code

Additional test, docs & proposed cleanup needs to happen on top of this.

* update create_model to allow user to specify included or excluded col… (#16)

* update create_model to allow user to specify included or excluded columns

* made minor changes stylistically and with added ValueError outputs

* Update doc gen & module structure. Add unit & system tests

* added two new func: set time, get table address (#23)

* added two new func: set time, get table address

* changed indentation

* Add system tests

* Address linter & python2.7 import errors

* Passes **kwargs through to client & implements missing methods

* Support BQ as input/output in batch_predict

* Address first round of feedback

* Switch to pytest.raises, fix .rst formatting exception

* Make list system tests more stringent
  • Loading branch information
lwander authored and sirtorry committed Aug 14, 2019
1 parent d1785b5 commit e9ea9ed
Show file tree
Hide file tree
Showing 9 changed files with 4,245 additions and 1 deletion.
29 changes: 29 additions & 0 deletions automl/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,32 @@ Next Steps
API to see other available methods on the client.
- Read the `Product documentation`_ to learn
more about the product and see How-to Guides.

Making & Testing Local Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to make changes to this library, here is how to set up your
development environment:

1. Make sure you have `virtualenv`_ installed and activated as shown above.
2. Run the following one-time setup (it will be persisted in your virtualenv):

.. code-block:: console
pip install -r ../docs/requirements.txt
pip install -U nox mock pytest
3. If you want to run all tests, you will need a billing-enabled
`GCP project`_, and a `service account`_ with access to the AutoML APIs.
Note: the first time the tests run in a new project it will take a _long_
time, on the order of 2-3 hours. This is one-time setup that will be skipped
in future runs.

.. _service account: https://cloud.google.com/iam/docs/creating-managing-service-accounts
.. _GCP project: https://cloud.google.com/resource-manager/docs/creating-managing-projects

.. code-block:: console
export PROJECT_ID=<project-id> GOOGLE_APPLICATION_CREDENTIALS=</path/to/creds.json>
nox
5 changes: 5 additions & 0 deletions automl/docs/gapic/v1beta1/tables.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A tables-specific client for AutoML
===================================

.. automodule:: google.cloud.automl_v1beta1.tables.tables_client
:members:
1 change: 1 addition & 0 deletions automl/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Api Reference

gapic/v1beta1/api
gapic/v1beta1/types
gapic/v1beta1/tables


Changelog
Expand Down
7 changes: 6 additions & 1 deletion automl/google/cloud/automl_v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
from google.cloud.automl_v1beta1.gapic import auto_ml_client
from google.cloud.automl_v1beta1.gapic import enums
from google.cloud.automl_v1beta1.gapic import prediction_service_client
from google.cloud.automl_v1beta1.tables import tables_client


class TablesClient(tables_client.TablesClient):
__doc__ = tables_client.TablesClient.__doc__


class AutoMlClient(auto_ml_client.AutoMlClient):
Expand All @@ -33,4 +38,4 @@ class PredictionServiceClient(prediction_service_client.PredictionServiceClient)
enums = enums


__all__ = ("enums", "types", "AutoMlClient", "PredictionServiceClient")
__all__ = ("enums", "types", "AutoMlClient", "PredictionServiceClient", "TablesClient")
Empty file.
Loading

0 comments on commit e9ea9ed

Please sign in to comment.