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

sync forks #26

Merged
merged 4 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 32 additions & 0 deletions bigquery/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@

[1]: https://pypi.org/project/google-cloud-bigquery/#history

## 1.18.0

08-08-2019 12:28 PDT

### New Features

- Add `bqstorage_client` param to `QueryJob.to_arrow()` ([#8693](https://github.com/googleapis/google-cloud-python/pull/8693))
- Include SQL query and job ID in exception messages. ([#8748](https://github.com/googleapis/google-cloud-python/pull/8748))
- Allow using TableListItem to construct a Table object. ([#8738](https://github.com/googleapis/google-cloud-python/pull/8738))
- Add StandardSqlDataTypes enum to BigQuery ([#8782](https://github.com/googleapis/google-cloud-python/pull/8782))
- Add `to_standard_sql()` method to SchemaField ([#8880](https://github.com/googleapis/google-cloud-python/pull/8880))
- Add debug logging statements to track when BQ Storage API is used. ([#8838](https://github.com/googleapis/google-cloud-python/pull/8838))
- Hide error traceback in BigQuery cell magic ([#8808](https://github.com/googleapis/google-cloud-python/pull/8808))
- Allow choice of compression when loading from dataframe ([#8938](https://github.com/googleapis/google-cloud-python/pull/8938))
- Additional clustering metrics for BQML K-means models (via synth). ([#8945](https://github.com/googleapis/google-cloud-python/pull/8945))

### Documentation

- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288))
- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705))
- Remove redundant service account key code sample. ([#8891](https://github.com/googleapis/google-cloud-python/pull/8891))

### Internal / Testing Changes

- Fix several pytest "skip if" markers ([#8694](https://github.com/googleapis/google-cloud-python/pull/8694))
- Update tests to support conversion of NaN as NULL in pyarrow `0.14.*`. ([#8785](https://github.com/googleapis/google-cloud-python/pull/8785))
- Mock external calls in one of BigQuery unit tests ([#8727](https://github.com/googleapis/google-cloud-python/pull/8727))
- Set IPython user agent when running queries with IPython cell magic ([#8713](https://github.com/googleapis/google-cloud-python/pull/8713))
- Use configurable bucket name for GCS samples data in systems tests. ([#8783](https://github.com/googleapis/google-cloud-python/pull/8783))
- Move `maybe_fail_import()` to top level test utils ([#8840](https://github.com/googleapis/google-cloud-python/pull/8840))
- Set BQ Storage client user-agent when in Jupyter cell ([#8734](https://github.com/googleapis/google-cloud-python/pull/8734))

## 1.17.0

07-12-2019 07:56 PDT
Expand Down
2 changes: 1 addition & 1 deletion bigquery/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

name = "google-cloud-bigquery"
description = "Google BigQuery API client library"
version = "1.17.0"
version = "1.18.0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
Expand Down
26 changes: 11 additions & 15 deletions bigtable/docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from test_utils.retry import RetryErrors
from google.api_core.exceptions import NotFound
from google.api_core.exceptions import TooManyRequests
from google.api_core.exceptions import DeadlineExceeded
from google.cloud._helpers import UTC
from google.cloud.bigtable import Client
from google.cloud.bigtable import enums
Expand All @@ -45,6 +46,7 @@
INSTANCE_ID = "snippet-tests" + UNIQUE_SUFFIX
CLUSTER_ID = "clus-1-" + UNIQUE_SUFFIX
APP_PROFILE_ID = "app-prof" + UNIQUE_SUFFIX
TABLE_ID = "tabl-1" + UNIQUE_SUFFIX
ROUTING_POLICY_TYPE = enums.RoutingPolicyType.ANY
LOCATION_ID = "us-central1-f"
ALT_LOCATION_ID = "us-central1-a"
Expand All @@ -61,6 +63,7 @@
INSTANCES_TO_DELETE = []

retry_429 = RetryErrors(TooManyRequests, max_tries=9)
retry_504 = RetryErrors(DeadlineExceeded, max_tries=4)


class Config(object):
Expand All @@ -72,6 +75,7 @@ class Config(object):

CLIENT = None
INSTANCE = None
TABLE = None


def setup_module():
Expand All @@ -88,6 +92,8 @@ def setup_module():
operation = Config.INSTANCE.create(clusters=[cluster])
# We want to make sure the operation completes.
operation.result(timeout=100)
Config.TABLE = Config.INSTANCE.table(TABLE_ID)
retry_504(Config.TABLE.create)()


def teardown_module():
Expand Down Expand Up @@ -421,14 +427,6 @@ def test_bigtable_create_table():


def test_bigtable_list_tables():
from google.cloud.bigtable import Client
from google.cloud.bigtable import column_family

client = Client(admin=True)
instance = client.instance(INSTANCE_ID)
table = instance.table("to_list")
max_versions_rule = column_family.MaxVersionsGCRule(2)
table.create(column_families={"cf1": max_versions_rule})

# [START bigtable_list_tables]
from google.cloud.bigtable import Client
Expand All @@ -438,11 +436,9 @@ def test_bigtable_list_tables():
tables_list = instance.list_tables()
# [END bigtable_list_tables]

# Check if returned list has expected table
table_names = [table.name for table in tables_list]
try:
assert table.name in table_names
finally:
retry_429(table.delete)()
assert Config.TABLE.name in table_names


def test_bigtable_delete_cluster():
Expand Down Expand Up @@ -479,9 +475,10 @@ def test_bigtable_delete_instance():

client = Client(admin=True)

instance = client.instance("inst-my-123", instance_type=PRODUCTION, labels=LABELS)
instance_id = "snipt-inst-del" + UNIQUE_SUFFIX
instance = client.instance(instance_id, instance_type=PRODUCTION, labels=LABELS)
cluster = instance.cluster(
"clus-my-123",
"clus-to-delete" + UNIQUE_SUFFIX,
location_id=ALT_LOCATION_ID,
serve_nodes=1,
default_storage_type=STORAGE_TYPE,
Expand All @@ -499,7 +496,6 @@ def test_bigtable_delete_instance():

client = Client(admin=True)

instance_id = "inst-my-123"
instance_to_delete = client.instance(instance_id)
instance_to_delete.delete()
# [END bigtable_delete_instance]
Expand Down
4 changes: 2 additions & 2 deletions containeranalysis/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and retrieval of critical metadata about all of your software artifacts.

.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
.. _Container Analysis API: https://cloud.google.com/container-registry/docs/container-analysis
.. _Client Library Documentation: https://googleapis.dev/python/containeranalysis/latest/index.html
.. _Client Library Documentation: https://googleapis.dev/python/containeranalysis/latest
.. _Product Documentation: https://cloud.google.com/container-registry/docs/container-analysis

Quick Start
Expand Down Expand Up @@ -73,4 +73,4 @@ Next Steps
APIs that we cover.

.. _Container Analysis API Product documentation: https://cloud.google.com/container-registry/docs/container-analysis
.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
76 changes: 0 additions & 76 deletions containeranalysis/docs/README.rst

This file was deleted.

1 change: 1 addition & 0 deletions containeranalysis/docs/README.rst
2 changes: 1 addition & 1 deletion monitoring/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ with a few exceptions as noted on the individual method pages.
.. |compat_check_github| image:: https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dmonitoring
:target: https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dmonitoring
.. _Stackdriver Monitoring API: https://cloud.google.com/monitoring/api/ref_v3/rest/
.. _Client Library Documentation: https://google-cloud-python.readthedocs.io/en/latest/monitoring/
.. _Client Library Documentation: https://googleapis.dev/python/monitoring/latest
.. _Product Documentation: https://cloud.google.com/monitoring/docs

Quick Start
Expand Down
1 change: 1 addition & 0 deletions phishingprotection/docs/README.rst
1 change: 1 addition & 0 deletions phishingprotection/docs/changelog.md
85 changes: 11 additions & 74 deletions phishingprotection/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,83 +1,20 @@
Python Client for Phishing Protection API (`Alpha`_)
====================================================
.. include:: README.rst

`Phishing Protection API`_:

- `Client Library Documentation`_
- `Product Documentation`_

.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
.. _Phishing Protection API: https://cloud.google.com/phishingprotection
.. _Client Library Documentation: https://googleapis.dev/python/phishingprotection/latest
.. _Product Documentation: https://cloud.google.com/phishingprotection

Quick Start
-----------

In order to use this library, you first need to go through the following steps:

1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
3. `Enable the Phishing Protection API.`_
4. `Setup Authentication.`_

.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
.. _Enable the Phishing Protection API.: https://cloud.google.com/phishingprotection
.. _Setup Authentication.: https://googleapis.dev/python/phishingprotection/latest

Installation
~~~~~~~~~~~~

Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.

With `virtualenv`_, it's possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.

.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/


Mac/Linux
^^^^^^^^^

.. code-block:: console

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-phishingprotection


Windows
^^^^^^^

.. code-block:: console
Api Reference
-------------
.. toctree::
:maxdepth: 2

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-phishingprotection
gapic/v1beta1/api
gapic/v1beta1/types

Next Steps
~~~~~~~~~~

- Read the `Client Library Documentation`_ for Phishing Protection API
API to see other available methods on the client.
- Read the `Phishing Protection API Product documentation`_ to learn
more about the product and see How-to Guides.
- View this `repository’s main README`_ to see the full list of Cloud
APIs that we cover.
Changelog
----------

.. _Phishing Protection API Product documentation: https://cloud.google.com/phishingprotection
.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
For all previous ``google-cloud-phishingprotection`` releases:

Api Reference
-------------
.. toctree::
:maxdepth: 2

gapic/v1beta1/api
gapic/v1beta1/types
changelog
4 changes: 2 additions & 2 deletions storage/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,9 @@ class TestAnonymousClient(unittest.TestCase):
def test_access_to_public_bucket(self):
anonymous = storage.Client.create_anonymous_client()
bucket = anonymous.bucket(self.PUBLIC_BUCKET)
blob, = bucket.list_blobs(max_results=1)
blob, = retry_429_503(bucket.list_blobs)(max_results=1)
with tempfile.TemporaryFile() as stream:
blob.download_to_file(stream)
retry_429_503(blob.download_to_file)(stream)


class TestKMSIntegration(TestStorageFiles):
Expand Down