Skip to content
Closed
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
5 changes: 4 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# Generated by synthtool. DO NOT EDIT!
[run]
branch = True
omit =
google/cloud/__init__.py

[report]
fail_under = 100
Expand All @@ -32,4 +34,5 @@ omit =
*/gapic/*.py
*/proto/*.py
*/core/*.py
*/site-packages/*.py
*/site-packages/*.py
google/cloud/__init__.py
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.6/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.6"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py36"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-firestore/.kokoro/test-samples.sh"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.7/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.7"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py37"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-firestore/.kokoro/test-samples.sh"
Expand Down
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.8/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ env_vars: {
value: "py-3.8"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py38"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-firestore/.kokoro/test-samples.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from google.auth import credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation as ga_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.api_core import operation as ga_operation
from google.api_core import operation_async
from google.cloud.firestore_admin_v1.services.firestore_admin import pagers
from google.cloud.firestore_admin_v1.types import field
from google.cloud.firestore_admin_v1.types import field as gfa_field
Expand Down Expand Up @@ -274,8 +274,8 @@ async def list_indexes(
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -362,8 +362,8 @@ async def get_index(
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -437,8 +437,8 @@ async def delete_index(
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -520,8 +520,8 @@ async def get_field(
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -713,8 +713,8 @@ async def list_fields(
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down
30 changes: 15 additions & 15 deletions google/cloud/firestore_admin_v1/services/firestore_admin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
from distutils import util
import os
import re
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from typing import Callable, Dict, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
Expand All @@ -32,8 +32,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation as ga_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.api_core import operation as ga_operation
from google.api_core import operation_async
from google.cloud.firestore_admin_v1.services.firestore_admin import pagers
from google.cloud.firestore_admin_v1.types import field
from google.cloud.firestore_admin_v1.types import field as gfa_field
Expand Down Expand Up @@ -175,9 +175,9 @@ def parse_index_path(path: str) -> Dict[str, str]:
def __init__(
self,
*,
credentials: Optional[credentials.Credentials] = None,
transport: Union[str, FirestoreAdminTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
credentials: credentials.Credentials = None,
transport: Union[str, FirestoreAdminTransport] = None,
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the firestore admin client.
Expand All @@ -191,8 +191,8 @@ def __init__(
transport (Union[str, ~.FirestoreAdminTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (client_options_lib.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
client_options (ClientOptions): Custom options for the client. It
won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
environment variable can also be used to override the endpoint:
Expand All @@ -218,9 +218,9 @@ def __init__(
creation failed for any reason.
"""
if isinstance(client_options, dict):
client_options = client_options_lib.from_dict(client_options)
client_options = ClientOptions.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = ClientOptions.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
Expand Down Expand Up @@ -377,7 +377,7 @@ def create_index(
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)

# Wrap the response in an operation future.
response = ga_operation.from_gapic(
response = operation.from_gapic(
response,
self._transport.operations_client,
gfa_index.Index,
Expand Down Expand Up @@ -779,7 +779,7 @@ def update_field(
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)

# Wrap the response in an operation future.
response = ga_operation.from_gapic(
response = operation.from_gapic(
response,
self._transport.operations_client,
gfa_field.Field,
Expand Down Expand Up @@ -963,7 +963,7 @@ def export_documents(
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)

# Wrap the response in an operation future.
response = ga_operation.from_gapic(
response = operation.from_gapic(
response,
self._transport.operations_client,
gfa_operation.ExportDocumentsResponse,
Expand Down Expand Up @@ -1065,7 +1065,7 @@ def import_documents(
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)

# Wrap the response in an operation future.
response = ga_operation.from_gapic(
response = operation.from_gapic(
response,
self._transport.operations_client,
empty.Empty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def _prep_wrapped_messages(self, client_info):
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand All @@ -140,8 +140,8 @@ def _prep_wrapped_messages(self, client_info):
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand All @@ -155,8 +155,8 @@ def _prep_wrapped_messages(self, client_info):
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand All @@ -170,8 +170,8 @@ def _prep_wrapped_messages(self, client_info):
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand All @@ -188,8 +188,8 @@ def _prep_wrapped_messages(self, client_info):
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.InternalServerError,
),
),
default_timeout=60.0,
Expand Down
18 changes: 9 additions & 9 deletions google/cloud/firestore_v1/services/firestore/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ async def get_document(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -218,9 +218,9 @@ async def list_documents(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -396,9 +396,9 @@ async def delete_document(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -458,9 +458,9 @@ def batch_get_documents(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=300.0,
Expand Down Expand Up @@ -539,9 +539,9 @@ async def begin_transaction(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -710,9 +710,9 @@ async def rollback(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -770,9 +770,9 @@ def run_query(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=300.0,
Expand Down Expand Up @@ -947,9 +947,9 @@ def listen(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=86400.0,
Expand Down Expand Up @@ -1031,9 +1031,9 @@ async def list_collection_ids(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded,
exceptions.InternalServerError,
exceptions.ServiceUnavailable,
exceptions.DeadlineExceeded,
),
),
default_timeout=60.0,
Expand Down
Loading