Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 9fb86c9

Browse files
chore(python): fix warehouse-package-name for dataqna v1alpha (#195)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * add release-please-config.json * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: googleapis/googleapis@08f275f Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(python): fix warehouse-package-name for dataqna v1alpha PiperOrigin-RevId: 490515684 Source-Link: googleapis/googleapis@cfe5068 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e42503d009c31e064e4141e809cfbf1873ac64ae Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTQyNTAzZDAwOWMzMWUwNjRlNDE0MWU4MDljZmJmMTg3M2FjNjRhZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * configure release-please to use manifest Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent c219ed6 commit 9fb86c9

File tree

52 files changed

+505
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+505
-1096
lines changed

.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.8.2"
3+
}

docs/dataqna_v1alpha/types.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Dataqna v1alpha API
33

44
.. automodule:: google.cloud.dataqna_v1alpha.types
55
:members:
6-
:undoc-members:
76
:show-inheritance:

google/cloud/dataqna/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.dataqna import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.dataqna_v1alpha.services.auto_suggestion_service.async_client import (
1822
AutoSuggestionServiceAsyncClient,

google/cloud/dataqna/gapic_version.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "0.8.2" # {x-release-please-version}

google/cloud/dataqna/py.typed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-cloud-dataqna package uses inline types.
2+
# The google-cloud-data-qna package uses inline types.

google/cloud/dataqna_v1alpha/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.dataqna import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.auto_suggestion_service import (
1822
AutoSuggestionServiceAsyncClient,

google/cloud/dataqna_v1alpha/py.typed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-cloud-dataqna package uses inline types.
2+
# The google-cloud-data-qna package uses inline types.

google/cloud/dataqna_v1alpha/services/auto_suggestion_service/async_client.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
)
2030

2131
from google.api_core import exceptions as core_exceptions
2232
from google.api_core import gapic_v1
@@ -230,9 +240,9 @@ def transport(self) -> AutoSuggestionServiceTransport:
230240
def __init__(
231241
self,
232242
*,
233-
credentials: ga_credentials.Credentials = None,
243+
credentials: Optional[ga_credentials.Credentials] = None,
234244
transport: Union[str, AutoSuggestionServiceTransport] = "grpc_asyncio",
235-
client_options: ClientOptions = None,
245+
client_options: Optional[ClientOptions] = None,
236246
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
237247
) -> None:
238248
"""Instantiates the auto suggestion service client.
@@ -276,10 +286,12 @@ def __init__(
276286

277287
async def suggest_queries(
278288
self,
279-
request: Union[auto_suggestion_service.SuggestQueriesRequest, dict] = None,
289+
request: Optional[
290+
Union[auto_suggestion_service.SuggestQueriesRequest, dict]
291+
] = None,
280292
*,
281293
retry: OptionalRetry = gapic_v1.method.DEFAULT,
282-
timeout: float = None,
294+
timeout: Optional[float] = None,
283295
metadata: Sequence[Tuple[str, str]] = (),
284296
) -> auto_suggestion_service.SuggestQueriesResponse:
285297
r"""Gets a list of suggestions based on a prefix string.
@@ -312,7 +324,7 @@ async def sample_suggest_queries():
312324
print(response)
313325
314326
Args:
315-
request (Union[google.cloud.dataqna_v1alpha.types.SuggestQueriesRequest, dict]):
327+
request (Optional[Union[google.cloud.dataqna_v1alpha.types.SuggestQueriesRequest, dict]]):
316328
The request object. Request for query suggestions.
317329
retry (google.api_core.retry.Retry): Designation of what errors, if any,
318330
should be retried.
@@ -362,7 +374,7 @@ async def __aexit__(self, exc_type, exc, tb):
362374
try:
363375
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
364376
gapic_version=pkg_resources.get_distribution(
365-
"google-cloud-dataqna",
377+
"google-cloud-data-qna",
366378
).version,
367379
)
368380
except pkg_resources.DistributionNotFound:

google/cloud/dataqna_v1alpha/services/auto_suggestion_service/client.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
cast,
30+
)
2031

2132
from google.api_core import client_options as client_options_lib
2233
from google.api_core import exceptions as core_exceptions
@@ -59,7 +70,7 @@ class AutoSuggestionServiceClientMeta(type):
5970

6071
def get_transport_class(
6172
cls,
62-
label: str = None,
73+
label: Optional[str] = None,
6374
) -> Type[AutoSuggestionServiceTransport]:
6475
"""Returns an appropriate transport class.
6576
@@ -383,8 +394,8 @@ def __init__(
383394
self,
384395
*,
385396
credentials: Optional[ga_credentials.Credentials] = None,
386-
transport: Union[str, AutoSuggestionServiceTransport, None] = None,
387-
client_options: Optional[client_options_lib.ClientOptions] = None,
397+
transport: Optional[Union[str, AutoSuggestionServiceTransport]] = None,
398+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
388399
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
389400
) -> None:
390401
"""Instantiates the auto suggestion service client.
@@ -401,7 +412,7 @@ def __init__(
401412
NOTE: "rest" transport functionality is currently in a
402413
beta state (preview). We welcome your feedback via an
403414
issue in this library's source repository.
404-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
415+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
405416
client. It won't take effect if a ``transport`` instance is provided.
406417
(1) The ``api_endpoint`` property can be used to override the
407418
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -431,6 +442,7 @@ def __init__(
431442
client_options = client_options_lib.from_dict(client_options)
432443
if client_options is None:
433444
client_options = client_options_lib.ClientOptions()
445+
client_options = cast(client_options_lib.ClientOptions, client_options)
434446

435447
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
436448
client_options
@@ -483,10 +495,12 @@ def __init__(
483495

484496
def suggest_queries(
485497
self,
486-
request: Union[auto_suggestion_service.SuggestQueriesRequest, dict] = None,
498+
request: Optional[
499+
Union[auto_suggestion_service.SuggestQueriesRequest, dict]
500+
] = None,
487501
*,
488502
retry: OptionalRetry = gapic_v1.method.DEFAULT,
489-
timeout: float = None,
503+
timeout: Optional[float] = None,
490504
metadata: Sequence[Tuple[str, str]] = (),
491505
) -> auto_suggestion_service.SuggestQueriesResponse:
492506
r"""Gets a list of suggestions based on a prefix string.
@@ -577,7 +591,7 @@ def __exit__(self, type, value, traceback):
577591
try:
578592
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
579593
gapic_version=pkg_resources.get_distribution(
580-
"google-cloud-dataqna",
594+
"google-cloud-data-qna",
581595
).version,
582596
)
583597
except pkg_resources.DistributionNotFound:

0 commit comments

Comments
 (0)