Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#400)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 459095142

Source-Link: googleapis/googleapis@4f1be99

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


PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

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

chore: use gapic-generator-python 1.0.0
PiperOrigin-RevId: 451250442

Source-Link: googleapis/googleapis@cca5e81

Source-Link: googleapis/googleapis-gen@0b219da
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9

PiperOrigin-RevId: 444333013

Source-Link: googleapis/googleapis@f91b6cf

Source-Link: googleapis/googleapis-gen@16eb360
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9

PiperOrigin-RevId: 441524537

Source-Link: googleapis/googleapis@2a27391

Source-Link: googleapis/googleapis-gen@ab6756a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9

PiperOrigin-RevId: 440970084

Source-Link: googleapis/googleapis@5e0a3d5

Source-Link: googleapis/googleapis-gen@b0c628a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBjNjI4YTNmYWRlNzY4ZjIyNWQ3Njk5Mjc5MWVhMWJhMmE4ODFiZSJ9


PiperOrigin-RevId: 440589618

Source-Link: googleapis/googleapis@cef1167

Source-Link: googleapis/googleapis-gen@0e0e2c9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGUwZTJjOTY1MjEwNDY2ODMyMzI2YzhlNTczNmRhNDYxMDU0YmNhNCJ9

Committer: @Harwayne
PiperOrigin-RevId: 440226213

Source-Link: googleapis/googleapis@c782e45

Source-Link: googleapis/googleapis-gen@d45c242
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDQ1YzI0MmVlODFmZmNiYmI5ZWI5ODUzMThjZTg5N2FjMGQ3NzhhZiJ9


Committer: @Harwayne
PiperOrigin-RevId: 440224385

Source-Link: googleapis/googleapis@afc5066

Source-Link: googleapis/googleapis-gen@07cf54a
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdjZjU0YWE2NjYzOGNiOTJlMmRiNmE2NjI0Y2IzZGE5OTI5NzQwYSJ9

feat: add audience parameter
fix!: Move `yarn_config` into a `oneof`
fix!: Remove `temp_bucket` from VirtualClusterConfig, as its value was not used
  • Loading branch information
gcf-owl-bot[bot] committed Jul 19, 2022
1 parent 3e249b9 commit 61a23fa
Show file tree
Hide file tree
Showing 42 changed files with 4,873 additions and 532 deletions.
Binary file added dataproc-v1-py.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
Expand Down Expand Up @@ -231,9 +231,9 @@ async def create_autoscaling_policy(
from google.cloud import dataproc_v1
def sample_create_autoscaling_policy():
async def sample_create_autoscaling_policy():
# Create a client
client = dataproc_v1.AutoscalingPolicyServiceClient()
client = dataproc_v1.AutoscalingPolicyServiceAsyncClient()
# Initialize request argument(s)
policy = dataproc_v1.AutoscalingPolicy()
Expand All @@ -247,7 +247,7 @@ def sample_create_autoscaling_policy():
)
# Make the request
response = client.create_autoscaling_policy(request=request)
response = await client.create_autoscaling_policy(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -353,14 +353,13 @@ async def update_autoscaling_policy(
Disabled check for update_mask, because all updates will be full
replacements.
.. code-block:: python
from google.cloud import dataproc_v1
def sample_update_autoscaling_policy():
async def sample_update_autoscaling_policy():
# Create a client
client = dataproc_v1.AutoscalingPolicyServiceClient()
client = dataproc_v1.AutoscalingPolicyServiceAsyncClient()
# Initialize request argument(s)
policy = dataproc_v1.AutoscalingPolicy()
Expand All @@ -373,7 +372,7 @@ def sample_update_autoscaling_policy():
)
# Make the request
response = client.update_autoscaling_policy(request=request)
response = await client.update_autoscaling_policy(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -470,17 +469,17 @@ async def get_autoscaling_policy(
from google.cloud import dataproc_v1
def sample_get_autoscaling_policy():
async def sample_get_autoscaling_policy():
# Create a client
client = dataproc_v1.AutoscalingPolicyServiceClient()
client = dataproc_v1.AutoscalingPolicyServiceAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.GetAutoscalingPolicyRequest(
name="name_value",
)
# Make the request
response = client.get_autoscaling_policy(request=request)
response = await client.get_autoscaling_policy(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -587,9 +586,9 @@ async def list_autoscaling_policies(
from google.cloud import dataproc_v1
def sample_list_autoscaling_policies():
async def sample_list_autoscaling_policies():
# Create a client
client = dataproc_v1.AutoscalingPolicyServiceClient()
client = dataproc_v1.AutoscalingPolicyServiceAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.ListAutoscalingPoliciesRequest(
Expand All @@ -600,7 +599,7 @@ def sample_list_autoscaling_policies():
page_result = client.list_autoscaling_policies(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -715,22 +714,21 @@ async def delete_autoscaling_policy(
delete an autoscaling policy that is in use by one or
more clusters.
.. code-block:: python
from google.cloud import dataproc_v1
def sample_delete_autoscaling_policy():
async def sample_delete_autoscaling_policy():
# Create a client
client = dataproc_v1.AutoscalingPolicyServiceClient()
client = dataproc_v1.AutoscalingPolicyServiceAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.DeleteAutoscalingPolicyRequest(
name="name_value",
)
# Make the request
client.delete_autoscaling_policy(request=request)
await client.delete_autoscaling_policy(request=request)
Args:
request (Union[google.cloud.dataproc_v1.types.DeleteAutoscalingPolicyRequest, dict]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib
Expand Down Expand Up @@ -426,6 +426,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_autoscaling_policy(
Expand Down Expand Up @@ -570,7 +571,6 @@ def update_autoscaling_policy(
Disabled check for update_mask, because all updates will be full
replacements.
.. code-block:: python
from google.cloud import dataproc_v1
Expand Down Expand Up @@ -906,7 +906,6 @@ def delete_autoscaling_policy(
delete an autoscaling policy that is in use by one or
more clusters.
.. code-block:: python
from google.cloud import dataproc_v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,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 All @@ -81,10 +82,6 @@ def __init__(
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
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}

Expand All @@ -106,6 +103,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 @@ -118,6 +120,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 Expand Up @@ -244,5 +251,9 @@ def delete_autoscaling_policy(
]:
raise NotImplementedError()

@property
def kind(self) -> str:
raise NotImplementedError()


__all__ = ("AutoscalingPolicyServiceTransport",)
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 Expand Up @@ -381,5 +383,9 @@ def delete_autoscaling_policy(
def close(self):
self.grpc_channel.close()

@property
def kind(self) -> str:
return "grpc"


__all__ = ("AutoscalingPolicyServiceGrpcTransport",)
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
28 changes: 13 additions & 15 deletions google/cloud/dataproc_v1/services/batch_controller/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions
Expand Down Expand Up @@ -223,14 +223,13 @@ async def create_batch(
r"""Creates a batch workload that executes
asynchronously.
.. code-block:: python
from google.cloud import dataproc_v1
def sample_create_batch():
async def sample_create_batch():
# Create a client
client = dataproc_v1.BatchControllerClient()
client = dataproc_v1.BatchControllerAsyncClient()
# Initialize request argument(s)
batch = dataproc_v1.Batch()
Expand All @@ -246,7 +245,7 @@ def sample_create_batch():
print("Waiting for operation to complete...")
response = operation.result()
response = await operation.result()
# Handle the response
print(response)
Expand Down Expand Up @@ -361,17 +360,17 @@ async def get_batch(
from google.cloud import dataproc_v1
def sample_get_batch():
async def sample_get_batch():
# Create a client
client = dataproc_v1.BatchControllerClient()
client = dataproc_v1.BatchControllerAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.GetBatchRequest(
name="name_value",
)
# Make the request
response = client.get_batch(request=request)
response = await client.get_batch(request=request)
# Handle the response
print(response)
Expand Down Expand Up @@ -456,9 +455,9 @@ async def list_batches(
from google.cloud import dataproc_v1
def sample_list_batches():
async def sample_list_batches():
# Create a client
client = dataproc_v1.BatchControllerClient()
client = dataproc_v1.BatchControllerAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.ListBatchesRequest(
Expand All @@ -469,7 +468,7 @@ def sample_list_batches():
page_result = client.list_batches(request=request)
# Handle the response
for response in page_result:
async for response in page_result:
print(response)
Args:
Expand Down Expand Up @@ -561,22 +560,21 @@ async def delete_batch(
terminal state, the delete fails and the response returns
``FAILED_PRECONDITION``.
.. code-block:: python
from google.cloud import dataproc_v1
def sample_delete_batch():
async def sample_delete_batch():
# Create a client
client = dataproc_v1.BatchControllerClient()
client = dataproc_v1.BatchControllerAsyncClient()
# Initialize request argument(s)
request = dataproc_v1.DeleteBatchRequest(
name="name_value",
)
# Make the request
client.delete_batch(request=request)
await client.delete_batch(request=request)
Args:
request (Union[google.cloud.dataproc_v1.types.DeleteBatchRequest, dict]):
Expand Down
5 changes: 2 additions & 3 deletions google/cloud/dataproc_v1/services/batch_controller/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib
Expand Down Expand Up @@ -431,6 +431,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_batch(
Expand All @@ -447,7 +448,6 @@ def create_batch(
r"""Creates a batch workload that executes
asynchronously.
.. code-block:: python
from google.cloud import dataproc_v1
Expand Down Expand Up @@ -785,7 +785,6 @@ def delete_batch(
terminal state, the delete fails and the response returns
``FAILED_PRECONDITION``.
.. code-block:: python
from google.cloud import dataproc_v1
Expand Down
Loading

0 comments on commit 61a23fa

Please sign in to comment.