From eb4fe8e5a13681ca1ae0909e941b9c28d216b887 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 15:26:15 -0700 Subject: [PATCH] feat: Add bloom filter related proto fields (only in the preview API surface) (#707) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add bloom filter related proto fields (only in the preview API surface) PiperOrigin-RevId: 527090049 Source-Link: https://github.com/googleapis/googleapis/commit/e2b7cb94f3e78df146a05744170353bc60c4ec21 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b0d2cc1c48ddac1c5dbac1ce199d29eaf1c5ec0c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjBkMmNjMWM0OGRkYWMxYzVkYmFjMWNlMTk5ZDI5ZWFmMWM1ZWMwYyJ9 * 🦉 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 Co-authored-by: Mariatta Wijaya --- .../services/firestore/async_client.py | 6 ++-- .../firestore_v1/services/firestore/client.py | 6 ++-- .../services/firestore/transports/grpc.py | 6 ++-- .../firestore/transports/grpc_asyncio.py | 6 ++-- google/cloud/firestore_v1/types/firestore.py | 10 ++++-- google/cloud/firestore_v1/types/query.py | 34 ++++++++++++------- 6 files changed, 41 insertions(+), 27 deletions(-) diff --git a/google/cloud/firestore_v1/services/firestore/async_client.py b/google/cloud/firestore_v1/services/firestore/async_client.py index d5bee7826c..9e12940841 100644 --- a/google/cloud/firestore_v1/services/firestore/async_client.py +++ b/google/cloud/firestore_v1/services/firestore/async_client.py @@ -1430,8 +1430,8 @@ def write( metadata: Sequence[Tuple[str, str]] = (), ) -> Awaitable[AsyncIterable[firestore.WriteResponse]]: r"""Streams batches of document updates and deletes, in - order. This method is only available via the gRPC API - (not REST). + order. This method is only available via gRPC or + WebChannel (not REST). .. code-block:: python @@ -1531,7 +1531,7 @@ def listen( metadata: Sequence[Tuple[str, str]] = (), ) -> Awaitable[AsyncIterable[firestore.ListenResponse]]: r"""Listens to changes. This method is only available via - the gRPC API (not REST). + gRPC or WebChannel (not REST). .. code-block:: python diff --git a/google/cloud/firestore_v1/services/firestore/client.py b/google/cloud/firestore_v1/services/firestore/client.py index 27507a7b82..27898cd61e 100644 --- a/google/cloud/firestore_v1/services/firestore/client.py +++ b/google/cloud/firestore_v1/services/firestore/client.py @@ -1520,8 +1520,8 @@ def write( metadata: Sequence[Tuple[str, str]] = (), ) -> Iterable[firestore.WriteResponse]: r"""Streams batches of document updates and deletes, in - order. This method is only available via the gRPC API - (not REST). + order. This method is only available via gRPC or + WebChannel (not REST). .. code-block:: python @@ -1617,7 +1617,7 @@ def listen( metadata: Sequence[Tuple[str, str]] = (), ) -> Iterable[firestore.ListenResponse]: r"""Listens to changes. This method is only available via - the gRPC API (not REST). + gRPC or WebChannel (not REST). .. code-block:: python diff --git a/google/cloud/firestore_v1/services/firestore/transports/grpc.py b/google/cloud/firestore_v1/services/firestore/transports/grpc.py index ad99b92497..851b2d7209 100644 --- a/google/cloud/firestore_v1/services/firestore/transports/grpc.py +++ b/google/cloud/firestore_v1/services/firestore/transports/grpc.py @@ -555,8 +555,8 @@ def write(self) -> Callable[[firestore.WriteRequest], firestore.WriteResponse]: r"""Return a callable for the write method over gRPC. Streams batches of document updates and deletes, in - order. This method is only available via the gRPC API - (not REST). + order. This method is only available via gRPC or + WebChannel (not REST). Returns: Callable[[~.WriteRequest], @@ -581,7 +581,7 @@ def listen(self) -> Callable[[firestore.ListenRequest], firestore.ListenResponse r"""Return a callable for the listen method over gRPC. Listens to changes. This method is only available via - the gRPC API (not REST). + gRPC or WebChannel (not REST). Returns: Callable[[~.ListenRequest], diff --git a/google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py b/google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py index 91296b2a33..14f1fceabb 100644 --- a/google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py +++ b/google/cloud/firestore_v1/services/firestore/transports/grpc_asyncio.py @@ -571,8 +571,8 @@ def write( r"""Return a callable for the write method over gRPC. Streams batches of document updates and deletes, in - order. This method is only available via the gRPC API - (not REST). + order. This method is only available via gRPC or + WebChannel (not REST). Returns: Callable[[~.WriteRequest], @@ -599,7 +599,7 @@ def listen( r"""Return a callable for the listen method over gRPC. Listens to changes. This method is only available via - the gRPC API (not REST). + gRPC or WebChannel (not REST). Returns: Callable[[~.ListenRequest], diff --git a/google/cloud/firestore_v1/types/firestore.py b/google/cloud/firestore_v1/types/firestore.py index 6d3940cba2..66ae004a21 100644 --- a/google/cloud/firestore_v1/types/firestore.py +++ b/google/cloud/firestore_v1/types/firestore.py @@ -886,8 +886,14 @@ class RunAggregationQueryResponse(proto.Message): Only present on the first response when the request requested to start a new transaction. read_time (google.protobuf.timestamp_pb2.Timestamp): - The time at which the aggregate value is - valid for. + The time at which the aggregate result was computed. This is + always monotonically increasing; in this case, the previous + AggregationResult in the result stream are guaranteed not to + have changed between their ``read_time`` and this one. + + If the query returns no results, a response with + ``read_time`` and no ``result`` will be sent, and this + represents the time at which the query was run. """ result: aggregation_result.AggregationResult = proto.Field( diff --git a/google/cloud/firestore_v1/types/query.py b/google/cloud/firestore_v1/types/query.py index 5d0080014f..e2dd3ebad4 100644 --- a/google/cloud/firestore_v1/types/query.py +++ b/google/cloud/firestore_v1/types/query.py @@ -38,7 +38,12 @@ class StructuredQuery(proto.Message): Attributes: select (google.cloud.firestore_v1.types.StructuredQuery.Projection): - The projection to return. + Optional sub-set of the fields to return. + + This acts as a + [DocumentMask][google.firestore.v1.DocumentMask] over the + documents returned from a query. When not set, assumes that + the caller wants all fields returned. from_ (MutableSequence[google.cloud.firestore_v1.types.StructuredQuery.CollectionSelector]): The collections to query. where (google.cloud.firestore_v1.types.StructuredQuery.Filter): @@ -328,18 +333,20 @@ class Operator(proto.Enum): Requires: - - That ``value`` is a non-empty ``ArrayValue`` with at most - 10 values. - - No other ``IN`` or ``ARRAY_CONTAINS_ANY`` or ``NOT_IN``. + - That ``value`` is a non-empty ``ArrayValue``, subject to + disjunction limits. + - No ``NOT_IN`` filters in the same query. ARRAY_CONTAINS_ANY (9): The given ``field`` is an array that contains any of the values in the given array. Requires: - - That ``value`` is a non-empty ``ArrayValue`` with at most - 10 values. - - No other ``IN`` or ``ARRAY_CONTAINS_ANY`` or ``NOT_IN``. + - That ``value`` is a non-empty ``ArrayValue``, subject to + disjunction limits. + - No other ``ARRAY_CONTAINS_ANY`` filters within the same + disjunction. + - No ``NOT_IN`` filters in the same query. NOT_IN (10): The value of the ``field`` is not in the given array. @@ -347,8 +354,9 @@ class Operator(proto.Enum): - That ``value`` is a non-empty ``ArrayValue`` with at most 10 values. - - No other ``IN``, ``ARRAY_CONTAINS_ANY``, ``NOT_IN``, - ``NOT_EQUAL``, ``IS_NOT_NULL``, or ``IS_NOT_NAN``. + - No other ``OR``, ``IN``, ``ARRAY_CONTAINS_ANY``, + ``NOT_IN``, ``NOT_EQUAL``, ``IS_NOT_NULL``, or + ``IS_NOT_NAN``. - That ``field`` comes first in the ``order_by``. """ OPERATOR_UNSPECIFIED = 0 @@ -558,7 +566,7 @@ class StructuredAggregationQuery(proto.Message): """ class Aggregation(proto.Message): - r"""Defines a aggregation that produces a single result. + r"""Defines an aggregation that produces a single result. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -581,7 +589,7 @@ class Aggregation(proto.Message): COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, - COUNT_UP_TO(4) + COUNT(*) OVER ( ... ); @@ -594,7 +602,7 @@ class Aggregation(proto.Message): COUNT_UP_TO(1) AS count_up_to_1, COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, - COUNT_UP_TO(4) AS field_2 + COUNT(*) AS field_2 OVER ( ... ); @@ -618,7 +626,7 @@ class Count(proto.Message): documents to count. This provides a way to set an upper bound on the number of - documents to scan, limiting latency and cost. + documents to scan, limiting latency, and cost. Unspecified is interpreted as no bound.