Skip to content

Commit

Permalink
fix(deps): require google-api-core >= 2.8.0 (#465)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 1.1.1

PiperOrigin-RevId: 459095142

Source-Link: googleapis/googleapis@4f1be99

Source-Link: googleapis/googleapis-gen@ae686d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9

fix: Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time

PiperOrigin-RevId: 457061436

Source-Link: googleapis/googleapis@8ff130b

Source-Link: googleapis/googleapis-gen@2eb0fac
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmViMGZhY2E3MTdkOWNmNDRiODM4YjdkYjVlODYyNDUxYjhhODZlZiJ9

feat: add audience parameter

PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

Source-Link: googleapis/googleapis-gen@4075a85
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9

feat: add fields to eventually contain row level errors

Committer: @gnanda
PiperOrigin-RevId: 456324780

Source-Link: googleapis/googleapis@f24b37a

Source-Link: googleapis/googleapis-gen@33f9d81
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzNmOWQ4MTQwODIxMTcxMTZjNGI2OGE2ZjVhYWMzZjQyYmVjMzVjMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix(deps): require google-api-core >= 2.8.0

* regenerate pb2 files using latest grpcio tools

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Jul 8, 2022
1 parent c13b1e5 commit 346c719
Show file tree
Hide file tree
Showing 32 changed files with 395 additions and 538 deletions.
2 changes: 2 additions & 0 deletions google/cloud/bigquery_storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from google.cloud.bigquery_storage_v1.types.storage import GetWriteStreamRequest
from google.cloud.bigquery_storage_v1.types.storage import ReadRowsRequest
from google.cloud.bigquery_storage_v1.types.storage import ReadRowsResponse
from google.cloud.bigquery_storage_v1.types.storage import RowError
from google.cloud.bigquery_storage_v1.types.storage import SplitReadStreamRequest
from google.cloud.bigquery_storage_v1.types.storage import SplitReadStreamResponse
from google.cloud.bigquery_storage_v1.types.storage import StorageError
Expand Down Expand Up @@ -86,6 +87,7 @@
"GetWriteStreamRequest",
"ReadRowsRequest",
"ReadRowsResponse",
"RowError",
"SplitReadStreamRequest",
"SplitReadStreamResponse",
"StorageError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,19 @@ async def sample_create_read_session():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
max_stream_count (:class:`int`):
Max initial number of streams. If
unset or zero, the server will provide a
value of streams so as to produce
reasonable throughput. Must be
non-negative. The number of streams may
be lower than the requested number,
depending on the amount parallelism that
is reasonable for the table. Error will
be returned if the max count is greater
than the current system max limit of
Max initial number of streams. If unset or zero, the
server will provide a value of streams so as to produce
reasonable throughput. Must be non-negative. The number
of streams may be lower than the requested number,
depending on the amount parallelism that is reasonable
for the table. There is a default system max limit of
1,000.
Streams must be read starting from
offset 0.
This must be greater than or equal to
preferred_min_stream_count. Typically, clients should
either leave this unset to let the system to determine
an upper bound OR set this a size for the maximum "units
of work" it can gracefully handle.
This corresponds to the ``max_stream_count`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
24 changes: 12 additions & 12 deletions google/cloud/bigquery_storage_v1/services/big_query_read/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def __init__(
quota_project_id=client_options.quota_project_id,
client_info=client_info,
always_use_jwt_access=True,
api_audience=client_options.api_audience,
)

def create_read_session(
Expand Down Expand Up @@ -546,20 +547,19 @@ def sample_create_read_session():
on the ``request`` instance; if ``request`` is provided, this
should not be set.
max_stream_count (int):
Max initial number of streams. If
unset or zero, the server will provide a
value of streams so as to produce
reasonable throughput. Must be
non-negative. The number of streams may
be lower than the requested number,
depending on the amount parallelism that
is reasonable for the table. Error will
be returned if the max count is greater
than the current system max limit of
Max initial number of streams. If unset or zero, the
server will provide a value of streams so as to produce
reasonable throughput. Must be non-negative. The number
of streams may be lower than the requested number,
depending on the amount parallelism that is reasonable
for the table. There is a default system max limit of
1,000.
Streams must be read starting from
offset 0.
This must be greater than or equal to
preferred_min_stream_count. Typically, clients should
either leave this unset to let the system to determine
an upper bound OR set this a size for the maximum "units
of work" it can gracefully handle.
This corresponds to the ``max_stream_count`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
**kwargs,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -85,11 +86,6 @@ def __init__(
be used for service account credentials.
"""

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
Expand All @@ -110,6 +106,11 @@ def __init__(
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(
api_audience if api_audience else host
)

# If the credentials are service account credentials, then always try to use self signed JWT.
if (
Expand All @@ -122,6 +123,11 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -155,6 +156,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def __init__(
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -200,6 +201,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,17 @@ async def sample_create_write_stream():
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_write_stream,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
initial=10.0,
maximum=120.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ResourceExhausted,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
deadline=1200.0,
),
default_timeout=600.0,
default_timeout=1200.0,
client_info=DEFAULT_CLIENT_INFO,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ def __init__(
quota_project_id=client_options.quota_project_id,
client_info=client_info,
always_use_jwt_access=True,
api_audience=client_options.api_audience,
)

def create_write_stream(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
**kwargs,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -86,11 +87,6 @@ def __init__(
be used for service account credentials.
"""

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
Expand All @@ -111,6 +107,11 @@ def __init__(
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(
api_audience if api_audience else host
)

# If the credentials are service account credentials, then always try to use self signed JWT.
if (
Expand All @@ -123,22 +124,28 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
host += ":443"
self._host = host

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.create_write_stream: gapic_v1.method.wrap_method(
self.create_write_stream,
default_retry=retries.Retry(
initial=0.1,
maximum=60.0,
initial=10.0,
maximum=120.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.DeadlineExceeded,
core_exceptions.ResourceExhausted,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
deadline=1200.0,
),
default_timeout=600.0,
default_timeout=1200.0,
client_info=client_info,
),
self.append_rows: gapic_v1.method.wrap_method(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -157,6 +158,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
api_audience: Optional[str] = None,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -202,6 +203,7 @@ def __init__(
quota_project_id=quota_project_id,
client_info=client_info,
always_use_jwt_access=always_use_jwt_access,
api_audience=api_audience,
)

if not self._grpc_channel:
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/bigquery_storage_v1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
GetWriteStreamRequest,
ReadRowsRequest,
ReadRowsResponse,
RowError,
SplitReadStreamRequest,
SplitReadStreamResponse,
StorageError,
Expand Down Expand Up @@ -79,6 +80,7 @@
"GetWriteStreamRequest",
"ReadRowsRequest",
"ReadRowsResponse",
"RowError",
"SplitReadStreamRequest",
"SplitReadStreamResponse",
"StorageError",
Expand Down
Loading

0 comments on commit 346c719

Please sign in to comment.