Skip to content
Permalink
Browse files
chore: use gapic-generator-python 0.53.4 (#341)
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent acc9224 commit 5390146e7bf83038a55755f53b119504ce000d62
Showing with 198 additions and 593 deletions.
  1. +12 −10 google/cloud/bigquery_storage_v1/services/big_query_read/async_client.py
  2. +5 −3 google/cloud/bigquery_storage_v1/services/big_query_read/client.py
  3. +1 −34 google/cloud/bigquery_storage_v1/services/big_query_read/transports/base.py
  4. +0 −1 google/cloud/bigquery_storage_v1/services/big_query_read/transports/grpc_asyncio.py
  5. +19 −17 google/cloud/bigquery_storage_v1/services/big_query_write/async_client.py
  6. +8 −6 google/cloud/bigquery_storage_v1/services/big_query_write/client.py
  7. +1 −34 google/cloud/bigquery_storage_v1/services/big_query_write/transports/base.py
  8. +0 −1 google/cloud/bigquery_storage_v1/services/big_query_write/transports/grpc_asyncio.py
  9. +24 −0 google/cloud/bigquery_storage_v1/types/storage.py
  10. +12 −0 google/cloud/bigquery_storage_v1/types/stream.py
  11. +12 −10 google/cloud/bigquery_storage_v1beta2/services/big_query_read/async_client.py
  12. +5 −3 google/cloud/bigquery_storage_v1beta2/services/big_query_read/client.py
  13. +1 −34 google/cloud/bigquery_storage_v1beta2/services/big_query_read/transports/base.py
  14. +0 −1 google/cloud/bigquery_storage_v1beta2/services/big_query_read/transports/grpc_asyncio.py
  15. +19 −17 google/cloud/bigquery_storage_v1beta2/services/big_query_write/async_client.py
  16. +8 −6 google/cloud/bigquery_storage_v1beta2/services/big_query_write/client.py
  17. +1 −34 google/cloud/bigquery_storage_v1beta2/services/big_query_write/transports/base.py
  18. +0 −1 google/cloud/bigquery_storage_v1beta2/services/big_query_write/transports/grpc_asyncio.py
  19. +23 −0 google/cloud/bigquery_storage_v1beta2/types/storage.py
  20. +9 −0 google/cloud/bigquery_storage_v1beta2/types/stream.py
  21. +1 −2 setup.py
  22. +1 −3 testing/constraints-3.6.txt
  23. +9 −94 tests/unit/gapic/bigquery_storage_v1/test_big_query_read.py
  24. +9 −94 tests/unit/gapic/bigquery_storage_v1/test_big_query_write.py
  25. +9 −94 tests/unit/gapic/bigquery_storage_v1beta2/test_big_query_read.py
  26. +9 −94 tests/unit/gapic/bigquery_storage_v1beta2/test_big_query_write.py
@@ -19,13 +19,15 @@
from typing import Dict, AsyncIterable, Awaitable, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.bigquery_storage_v1.types import arrow
from google.cloud.bigquery_storage_v1.types import avro
from google.cloud.bigquery_storage_v1.types import storage
@@ -168,12 +170,12 @@ def __init__(

async def create_read_session(
self,
request: storage.CreateReadSessionRequest = None,
request: Union[storage.CreateReadSessionRequest, dict] = None,
*,
parent: str = None,
read_session: stream.ReadSession = None,
max_stream_count: int = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.ReadSession:
@@ -202,7 +204,7 @@ async def create_read_session(
caller.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.CreateReadSessionRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.CreateReadSessionRequest, dict]):
The request object. Request message for
`CreateReadSession`.
parent (:class:`str`):
@@ -301,11 +303,11 @@ async def create_read_session(

def read_rows(
self,
request: storage.ReadRowsRequest = None,
request: Union[storage.ReadRowsRequest, dict] = None,
*,
read_stream: str = None,
offset: int = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Awaitable[AsyncIterable[storage.ReadRowsResponse]]:
@@ -319,7 +321,7 @@ def read_rows(
reflecting the current state of the stream.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.ReadRowsRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.ReadRowsRequest, dict]):
The request object. Request message for `ReadRows`.
read_stream (:class:`str`):
Required. Stream to read rows from.
@@ -400,9 +402,9 @@ def read_rows(

async def split_read_stream(
self,
request: storage.SplitReadStreamRequest = None,
request: Union[storage.SplitReadStreamRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.SplitReadStreamResponse:
@@ -421,7 +423,7 @@ async def split_read_stream(
once the streams have been read to completion.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.SplitReadStreamRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.SplitReadStreamRequest, dict]):
The request object. Request message for
`SplitReadStream`.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.bigquery_storage_v1.types import arrow
from google.cloud.bigquery_storage_v1.types import avro
from google.cloud.bigquery_storage_v1.types import storage
@@ -391,7 +393,7 @@ def create_read_session(
parent: str = None,
read_session: stream.ReadSession = None,
max_stream_count: int = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.ReadSession:
@@ -513,7 +515,7 @@ def read_rows(
*,
read_stream: str = None,
offset: int = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Iterable[storage.ReadRowsResponse]:
@@ -601,7 +603,7 @@ def split_read_stream(
self,
request: Union[storage.SplitReadStreamRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.SplitReadStreamResponse:
@@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

import google.auth # type: ignore
@@ -38,15 +37,6 @@
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class BigQueryReadTransport(abc.ABC):
"""Abstract transport class for BigQueryRead."""
@@ -100,7 +90,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
@@ -133,29 +123,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
@@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
@@ -28,13 +28,15 @@
)
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.bigquery_storage_v1.types import storage
from google.cloud.bigquery_storage_v1.types import stream
from google.cloud.bigquery_storage_v1.types import table
@@ -181,11 +183,11 @@ def __init__(

async def create_write_stream(
self,
request: storage.CreateWriteStreamRequest = None,
request: Union[storage.CreateWriteStreamRequest, dict] = None,
*,
parent: str = None,
write_stream: stream.WriteStream = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.WriteStream:
@@ -198,7 +200,7 @@ async def create_write_stream(
received.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.CreateWriteStreamRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.CreateWriteStreamRequest, dict]):
The request object. Request message for
`CreateWriteStream`.
parent (:class:`str`):
@@ -280,7 +282,7 @@ def append_rows(
self,
requests: AsyncIterator[storage.AppendRowsRequest] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Awaitable[AsyncIterable[storage.AppendRowsResponse]]:
@@ -366,17 +368,17 @@ def append_rows(

async def get_write_stream(
self,
request: storage.GetWriteStreamRequest = None,
request: Union[storage.GetWriteStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.WriteStream:
r"""Gets information about a write stream.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.GetWriteStreamRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.GetWriteStreamRequest, dict]):
The request object. Request message for
`GetWriteStreamRequest`.
name (:class:`str`):
@@ -448,18 +450,18 @@ async def get_write_stream(

async def finalize_write_stream(
self,
request: storage.FinalizeWriteStreamRequest = None,
request: Union[storage.FinalizeWriteStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.FinalizeWriteStreamResponse:
r"""Finalize a write stream so that no new data can be appended to
the stream. Finalize is not supported on the '_default' stream.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.FinalizeWriteStreamRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.FinalizeWriteStreamRequest, dict]):
The request object. Request message for invoking
`FinalizeWriteStream`.
name (:class:`str`):
@@ -528,10 +530,10 @@ async def finalize_write_stream(

async def batch_commit_write_streams(
self,
request: storage.BatchCommitWriteStreamsRequest = None,
request: Union[storage.BatchCommitWriteStreamsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.BatchCommitWriteStreamsResponse:
@@ -543,7 +545,7 @@ async def batch_commit_write_streams(
becomes available for read operations.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.BatchCommitWriteStreamsRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.BatchCommitWriteStreamsRequest, dict]):
The request object. Request message for
`BatchCommitWriteStreams`.
parent (:class:`str`):
@@ -613,10 +615,10 @@ async def batch_commit_write_streams(

async def flush_rows(
self,
request: storage.FlushRowsRequest = None,
request: Union[storage.FlushRowsRequest, dict] = None,
*,
write_stream: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.FlushRowsResponse:
@@ -632,7 +634,7 @@ async def flush_rows(
BUFFERED.
Args:
request (:class:`google.cloud.bigquery_storage_v1.types.FlushRowsRequest`):
request (Union[google.cloud.bigquery_storage_v1.types.FlushRowsRequest, dict]):
The request object. Request message for `FlushRows`.
write_stream (:class:`str`):
Required. The stream that is the
@@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.bigquery_storage_v1.types import storage
from google.cloud.bigquery_storage_v1.types import stream
from google.cloud.bigquery_storage_v1.types import table
@@ -374,7 +376,7 @@ def create_write_stream(
*,
parent: str = None,
write_stream: stream.WriteStream = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.WriteStream:
@@ -459,7 +461,7 @@ def append_rows(
self,
requests: Iterator[storage.AppendRowsRequest] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> Iterable[storage.AppendRowsResponse]:
@@ -535,7 +537,7 @@ def get_write_stream(
request: Union[storage.GetWriteStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> stream.WriteStream:
@@ -607,7 +609,7 @@ def finalize_write_stream(
request: Union[storage.FinalizeWriteStreamRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.FinalizeWriteStreamResponse:
@@ -677,7 +679,7 @@ def batch_commit_write_streams(
request: Union[storage.BatchCommitWriteStreamsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.BatchCommitWriteStreamsResponse:
@@ -754,7 +756,7 @@ def flush_rows(
request: Union[storage.FlushRowsRequest, dict] = None,
*,
write_stream: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> storage.FlushRowsResponse:

0 comments on commit 5390146

Please sign in to comment.