diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 894fb6bc9b..b8edda51cf 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:f62c53736eccb0c4934a3ea9316e0d57696bb49c1a7c86c726e9bb8a2f87dadf + digest: sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index cbd7e77f44..ec867d9fd6 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -1,10 +1,10 @@ gcp-docuploader -gcp-releasetool +gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x importlib-metadata typing-extensions twine wheel setuptools -nox +nox>=2022.11.21 # required to remove dependency on py charset-normalizer<3 click<8.1.0 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 096e4800a9..66a2172a76 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.9 +# by the following command: # # pip-compile --allow-unsafe --generate-hashes requirements.in # @@ -154,9 +154,9 @@ gcp-docuploader==0.6.4 \ --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.10.0 \ - --hash=sha256:72a38ca91b59c24f7e699e9227c90cbe4dd71b789383cb0164b088abae294c83 \ - --hash=sha256:8c7c99320208383d4bb2b808c6880eb7a81424afe7cdba3c8d84b25f4f0e097d +gcp-releasetool==1.10.5 \ + --hash=sha256:174b7b102d704b254f2a26a3eda2c684fd3543320ec239baf771542a2e58e109 \ + --hash=sha256:e29d29927fe2ca493105a82958c6873bb2b90d503acac56be2c229e74de0eec9 # via -r requirements.in google-api-core==2.10.2 \ --hash=sha256:10c06f7739fe57781f87523375e8e1a3a4674bf6392cd6131a3222182b971320 \ @@ -335,9 +335,9 @@ more-itertools==9.0.0 \ --hash=sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41 \ --hash=sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab # via jaraco-classes -nox==2022.8.7 \ - --hash=sha256:1b894940551dc5c389f9271d197ca5d655d40bdc6ccf93ed6880e4042760a34b \ - --hash=sha256:96cca88779e08282a699d672258ec01eb7c792d35bbbf538c723172bce23212c +nox==2022.11.21 \ + --hash=sha256:0e41a990e290e274cb205a976c4c97ee3c5234441a8132c8c3fd9ea3c22149eb \ + --hash=sha256:e21c31de0711d1274ca585a2c5fde36b1aa962005ba8e9322bf5eeed16dcd684 # via -r requirements.in packaging==21.3 \ --hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \ @@ -380,10 +380,6 @@ protobuf==3.20.3 \ # gcp-docuploader # gcp-releasetool # google-api-core -py==1.11.0 \ - --hash=sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719 \ - --hash=sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378 - # via nox pyasn1==0.4.8 \ --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a2cc302edb..ae9e03089c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.10.0" + ".": "2.10.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d0a21656e..6b952ae67d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ [1]: https://pypi.org/project/google-cloud-firestore/#history +## [2.10.1](https://github.com/googleapis/python-firestore/compare/v2.10.0...v2.10.1) (2023-03-23) + + +### Documentation + +* Fix formatting of request arg in docstring ([#700](https://github.com/googleapis/python-firestore/issues/700)) ([7b09f16](https://github.com/googleapis/python-firestore/commit/7b09f164f66a1387f34ccc4bee89eb3fd9e7b9fc)) + ## [2.10.0](https://github.com/googleapis/python-firestore/compare/v2.9.1...v2.10.0) (2023-02-21) diff --git a/google/cloud/firestore/gapic_version.py b/google/cloud/firestore/gapic_version.py index 00f0a8d070..3dded2070e 100644 --- a/google/cloud/firestore/gapic_version.py +++ b/google/cloud/firestore/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/firestore_admin_v1/gapic_version.py b/google/cloud/firestore_admin_v1/gapic_version.py index 00f0a8d070..3dded2070e 100644 --- a/google/cloud/firestore_admin_v1/gapic_version.py +++ b/google/cloud/firestore_admin_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py b/google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py index 1fc78a9ce7..8ada01fb26 100644 --- a/google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py +++ b/google/cloud/firestore_admin_v1/services/firestore_admin/async_client.py @@ -1531,7 +1531,8 @@ async def sample_list_databases(): Args: request (Optional[Union[google.cloud.firestore_admin_v1.types.ListDatabasesRequest, dict]]): The request object. A request to list the Firestore - Databases in all locations for a project. + Databases in all locations for a + project. parent (:class:`str`): Required. A parent name of the form ``projects/{project_id}`` diff --git a/google/cloud/firestore_admin_v1/services/firestore_admin/client.py b/google/cloud/firestore_admin_v1/services/firestore_admin/client.py index fdf99512aa..6b56646263 100644 --- a/google/cloud/firestore_admin_v1/services/firestore_admin/client.py +++ b/google/cloud/firestore_admin_v1/services/firestore_admin/client.py @@ -1762,7 +1762,8 @@ def sample_list_databases(): Args: request (Union[google.cloud.firestore_admin_v1.types.ListDatabasesRequest, dict]): The request object. A request to list the Firestore - Databases in all locations for a project. + Databases in all locations for a + project. parent (str): Required. A parent name of the form ``projects/{project_id}`` diff --git a/google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py b/google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py index abaee0a74f..25077e3df2 100644 --- a/google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py +++ b/google/cloud/firestore_admin_v1/services/firestore_admin/transports/rest.py @@ -33,7 +33,7 @@ from requests import __version__ as requests_version import dataclasses import re -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import warnings try: @@ -438,7 +438,7 @@ def pre_cancel_operation( self, request: operations_pb2.CancelOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> None: + ) -> Tuple[operations_pb2.CancelOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for cancel_operation Override in a subclass to manipulate the request or metadata @@ -446,9 +446,7 @@ def pre_cancel_operation( """ return request, metadata - def post_cancel_operation( - self, response: operations_pb2.CancelOperationRequest - ) -> None: + def post_cancel_operation(self, response: None) -> None: """Post-rpc interceptor for cancel_operation Override in a subclass to manipulate the response @@ -461,7 +459,7 @@ def pre_delete_operation( self, request: operations_pb2.DeleteOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> None: + ) -> Tuple[operations_pb2.DeleteOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for delete_operation Override in a subclass to manipulate the request or metadata @@ -469,9 +467,7 @@ def pre_delete_operation( """ return request, metadata - def post_delete_operation( - self, response: operations_pb2.DeleteOperationRequest - ) -> None: + def post_delete_operation(self, response: None) -> None: """Post-rpc interceptor for delete_operation Override in a subclass to manipulate the response @@ -484,7 +480,7 @@ def pre_get_operation( self, request: operations_pb2.GetOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.Operation: + ) -> Tuple[operations_pb2.GetOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for get_operation Override in a subclass to manipulate the request or metadata @@ -493,7 +489,7 @@ def pre_get_operation( return request, metadata def post_get_operation( - self, response: operations_pb2.GetOperationRequest + self, response: operations_pb2.Operation ) -> operations_pb2.Operation: """Post-rpc interceptor for get_operation @@ -507,7 +503,7 @@ def pre_list_operations( self, request: operations_pb2.ListOperationsRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.ListOperationsResponse: + ) -> Tuple[operations_pb2.ListOperationsRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for list_operations Override in a subclass to manipulate the request or metadata @@ -516,7 +512,7 @@ def pre_list_operations( return request, metadata def post_list_operations( - self, response: operations_pb2.ListOperationsRequest + self, response: operations_pb2.ListOperationsResponse ) -> operations_pb2.ListOperationsResponse: """Post-rpc interceptor for list_operations @@ -711,7 +707,7 @@ class _CreateIndex(FirestoreAdminRestStub): def __hash__(self): return hash("CreateIndex") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -735,7 +731,6 @@ def __call__( request (~.firestore_admin.CreateIndexRequest): The request object. The request for [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -809,7 +804,7 @@ class _DeleteIndex(FirestoreAdminRestStub): def __hash__(self): return hash("DeleteIndex") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -833,7 +828,6 @@ def __call__( request (~.firestore_admin.DeleteIndexRequest): The request object. The request for [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -885,7 +879,7 @@ class _ExportDocuments(FirestoreAdminRestStub): def __hash__(self): return hash("ExportDocuments") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -909,7 +903,6 @@ def __call__( request (~.firestore_admin.ExportDocumentsRequest): The request object. The request for [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -985,7 +978,7 @@ class _GetDatabase(FirestoreAdminRestStub): def __hash__(self): return hash("GetDatabase") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1009,7 +1002,6 @@ def __call__( request (~.firestore_admin.GetDatabaseRequest): The request object. The request for [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1076,7 +1068,7 @@ class _GetField(FirestoreAdminRestStub): def __hash__(self): return hash("GetField") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1100,7 +1092,6 @@ def __call__( request (~.firestore_admin.GetFieldRequest): The request object. The request for [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1169,7 +1160,7 @@ class _GetIndex(FirestoreAdminRestStub): def __hash__(self): return hash("GetIndex") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1193,7 +1184,6 @@ def __call__( request (~.firestore_admin.GetIndexRequest): The request object. The request for [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1260,7 +1250,7 @@ class _ImportDocuments(FirestoreAdminRestStub): def __hash__(self): return hash("ImportDocuments") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1284,7 +1274,6 @@ def __call__( request (~.firestore_admin.ImportDocumentsRequest): The request object. The request for [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1360,7 +1349,7 @@ class _ListDatabases(FirestoreAdminRestStub): def __hash__(self): return hash("ListDatabases") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1385,7 +1374,6 @@ def __call__( The request object. A request to list the Firestore Databases in all locations for a project. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1449,7 +1437,7 @@ class _ListFields(FirestoreAdminRestStub): def __hash__(self): return hash("ListFields") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1473,7 +1461,6 @@ def __call__( request (~.firestore_admin.ListFieldsRequest): The request object. The request for [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1539,7 +1526,7 @@ class _ListIndexes(FirestoreAdminRestStub): def __hash__(self): return hash("ListIndexes") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1563,7 +1550,6 @@ def __call__( request (~.firestore_admin.ListIndexesRequest): The request object. The request for [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1629,7 +1615,7 @@ class _UpdateDatabase(FirestoreAdminRestStub): def __hash__(self): return hash("UpdateDatabase") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1653,7 +1639,6 @@ def __call__( request (~.firestore_admin.UpdateDatabaseRequest): The request object. The request for [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1727,7 +1712,7 @@ class _UpdateField(FirestoreAdminRestStub): def __hash__(self): return hash("UpdateField") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1751,7 +1736,6 @@ def __call__( request (~.firestore_admin.UpdateFieldRequest): The request object. The request for [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/firestore_admin_v1/types/database.py b/google/cloud/firestore_admin_v1/types/database.py index 31f80880a6..e627091fb5 100644 --- a/google/cloud/firestore_admin_v1/types/database.py +++ b/google/cloud/firestore_admin_v1/types/database.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_admin_v1/types/field.py b/google/cloud/firestore_admin_v1/types/field.py index bb21b6121a..a272749902 100644 --- a/google/cloud/firestore_admin_v1/types/field.py +++ b/google/cloud/firestore_admin_v1/types/field.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_admin_v1/types/firestore_admin.py b/google/cloud/firestore_admin_v1/types/firestore_admin.py index c27234441a..32e68eb770 100644 --- a/google/cloud/firestore_admin_v1/types/firestore_admin.py +++ b/google/cloud/firestore_admin_v1/types/firestore_admin.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_admin_v1/types/index.py b/google/cloud/firestore_admin_v1/types/index.py index f3897dfb90..e0f55f99f2 100644 --- a/google/cloud/firestore_admin_v1/types/index.py +++ b/google/cloud/firestore_admin_v1/types/index.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_admin_v1/types/location.py b/google/cloud/firestore_admin_v1/types/location.py index 4ace1bed92..778883e7db 100644 --- a/google/cloud/firestore_admin_v1/types/location.py +++ b/google/cloud/firestore_admin_v1/types/location.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_admin_v1/types/operation.py b/google/cloud/firestore_admin_v1/types/operation.py index e156130615..46ade2166c 100644 --- a/google/cloud/firestore_admin_v1/types/operation.py +++ b/google/cloud/firestore_admin_v1/types/operation.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_bundle/gapic_version.py b/google/cloud/firestore_bundle/gapic_version.py index 00f0a8d070..3dded2070e 100644 --- a/google/cloud/firestore_bundle/gapic_version.py +++ b/google/cloud/firestore_bundle/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/firestore_bundle/types/bundle.py b/google/cloud/firestore_bundle/types/bundle.py index a405888e6e..5ed1a11979 100644 --- a/google/cloud/firestore_bundle/types/bundle.py +++ b/google/cloud/firestore_bundle/types/bundle.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/gapic_version.py b/google/cloud/firestore_v1/gapic_version.py index 00f0a8d070..3dded2070e 100644 --- a/google/cloud/firestore_v1/gapic_version.py +++ b/google/cloud/firestore_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.10.0" # {x-release-please-version} +__version__ = "2.10.1" # {x-release-please-version} diff --git a/google/cloud/firestore_v1/services/firestore/async_client.py b/google/cloud/firestore_v1/services/firestore/async_client.py index d8295e9ee4..d5bee7826c 100644 --- a/google/cloud/firestore_v1/services/firestore/async_client.py +++ b/google/cloud/firestore_v1/services/firestore/async_client.py @@ -1474,8 +1474,10 @@ def request_generator(): requests (AsyncIterator[`google.cloud.firestore_v1.types.WriteRequest`]): The request object AsyncIterator. The request for [Firestore.Write][google.firestore.v1.Firestore.Write]. + The first request creates a stream, or resumes an existing one from a token. + When creating a new stream, the server replies with a response containing only an ID and a token, to use in the next request. diff --git a/google/cloud/firestore_v1/services/firestore/client.py b/google/cloud/firestore_v1/services/firestore/client.py index 962255e126..27507a7b82 100644 --- a/google/cloud/firestore_v1/services/firestore/client.py +++ b/google/cloud/firestore_v1/services/firestore/client.py @@ -1564,8 +1564,10 @@ def request_generator(): requests (Iterator[google.cloud.firestore_v1.types.WriteRequest]): The request object iterator. The request for [Firestore.Write][google.firestore.v1.Firestore.Write]. + The first request creates a stream, or resumes an existing one from a token. + When creating a new stream, the server replies with a response containing only an ID and a token, to use in the next request. diff --git a/google/cloud/firestore_v1/services/firestore/transports/rest.py b/google/cloud/firestore_v1/services/firestore/transports/rest.py index 498aa7fff1..65276d2727 100644 --- a/google/cloud/firestore_v1/services/firestore/transports/rest.py +++ b/google/cloud/firestore_v1/services/firestore/transports/rest.py @@ -32,7 +32,7 @@ from requests import __version__ as requests_version import dataclasses import re -from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import warnings try: @@ -471,7 +471,7 @@ def pre_cancel_operation( self, request: operations_pb2.CancelOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> None: + ) -> Tuple[operations_pb2.CancelOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for cancel_operation Override in a subclass to manipulate the request or metadata @@ -479,9 +479,7 @@ def pre_cancel_operation( """ return request, metadata - def post_cancel_operation( - self, response: operations_pb2.CancelOperationRequest - ) -> None: + def post_cancel_operation(self, response: None) -> None: """Post-rpc interceptor for cancel_operation Override in a subclass to manipulate the response @@ -494,7 +492,7 @@ def pre_delete_operation( self, request: operations_pb2.DeleteOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> None: + ) -> Tuple[operations_pb2.DeleteOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for delete_operation Override in a subclass to manipulate the request or metadata @@ -502,9 +500,7 @@ def pre_delete_operation( """ return request, metadata - def post_delete_operation( - self, response: operations_pb2.DeleteOperationRequest - ) -> None: + def post_delete_operation(self, response: None) -> None: """Post-rpc interceptor for delete_operation Override in a subclass to manipulate the response @@ -517,7 +513,7 @@ def pre_get_operation( self, request: operations_pb2.GetOperationRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.Operation: + ) -> Tuple[operations_pb2.GetOperationRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for get_operation Override in a subclass to manipulate the request or metadata @@ -526,7 +522,7 @@ def pre_get_operation( return request, metadata def post_get_operation( - self, response: operations_pb2.GetOperationRequest + self, response: operations_pb2.Operation ) -> operations_pb2.Operation: """Post-rpc interceptor for get_operation @@ -540,7 +536,7 @@ def pre_list_operations( self, request: operations_pb2.ListOperationsRequest, metadata: Sequence[Tuple[str, str]], - ) -> operations_pb2.ListOperationsResponse: + ) -> Tuple[operations_pb2.ListOperationsRequest, Sequence[Tuple[str, str]]]: """Pre-rpc interceptor for list_operations Override in a subclass to manipulate the request or metadata @@ -549,7 +545,7 @@ def pre_list_operations( return request, metadata def post_list_operations( - self, response: operations_pb2.ListOperationsRequest + self, response: operations_pb2.ListOperationsResponse ) -> operations_pb2.ListOperationsResponse: """Post-rpc interceptor for list_operations @@ -667,7 +663,7 @@ class _BatchGetDocuments(FirestoreRestStub): def __hash__(self): return hash("BatchGetDocuments") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -691,7 +687,6 @@ def __call__( request (~.firestore.BatchGetDocumentsRequest): The request object. The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -767,7 +762,7 @@ class _BatchWrite(FirestoreRestStub): def __hash__(self): return hash("BatchWrite") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -791,7 +786,6 @@ def __call__( request (~.firestore.BatchWriteRequest): The request object. The request for [Firestore.BatchWrite][google.firestore.v1.Firestore.BatchWrite]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -866,7 +860,7 @@ class _BeginTransaction(FirestoreRestStub): def __hash__(self): return hash("BeginTransaction") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -890,7 +884,6 @@ def __call__( request (~.firestore.BeginTransactionRequest): The request object. The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -967,7 +960,7 @@ class _Commit(FirestoreRestStub): def __hash__(self): return hash("Commit") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -991,7 +984,6 @@ def __call__( request (~.firestore.CommitRequest): The request object. The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1066,7 +1058,7 @@ class _CreateDocument(FirestoreRestStub): def __hash__(self): return hash("CreateDocument") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1090,7 +1082,6 @@ def __call__( request (~.firestore.CreateDocumentRequest): The request object. The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1165,7 +1156,7 @@ class _DeleteDocument(FirestoreRestStub): def __hash__(self): return hash("DeleteDocument") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1189,7 +1180,6 @@ def __call__( request (~.firestore.DeleteDocumentRequest): The request object. The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1241,7 +1231,7 @@ class _GetDocument(FirestoreRestStub): def __hash__(self): return hash("GetDocument") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1265,7 +1255,6 @@ def __call__( request (~.firestore.GetDocumentRequest): The request object. The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1331,7 +1320,7 @@ class _ListCollectionIds(FirestoreRestStub): def __hash__(self): return hash("ListCollectionIds") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1355,7 +1344,6 @@ def __call__( request (~.firestore.ListCollectionIdsRequest): The request object. The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1437,7 +1425,7 @@ class _ListDocuments(FirestoreRestStub): def __hash__(self): return hash("ListDocuments") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1461,7 +1449,6 @@ def __call__( request (~.firestore.ListDocumentsRequest): The request object. The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1547,7 +1534,7 @@ class _PartitionQuery(FirestoreRestStub): def __hash__(self): return hash("PartitionQuery") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1571,7 +1558,6 @@ def __call__( request (~.firestore.PartitionQueryRequest): The request object. The request for [Firestore.PartitionQuery][google.firestore.v1.Firestore.PartitionQuery]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1651,7 +1637,7 @@ class _Rollback(FirestoreRestStub): def __hash__(self): return hash("Rollback") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1675,7 +1661,6 @@ def __call__( request (~.firestore.RollbackRequest): The request object. The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1736,7 +1721,7 @@ class _RunAggregationQuery(FirestoreRestStub): def __hash__(self): return hash("RunAggregationQuery") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1760,7 +1745,6 @@ def __call__( request (~.firestore.RunAggregationQueryRequest): The request object. The request for [Firestore.RunAggregationQuery][google.firestore.v1.Firestore.RunAggregationQuery]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1841,7 +1825,7 @@ class _RunQuery(FirestoreRestStub): def __hash__(self): return hash("RunQuery") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1865,7 +1849,6 @@ def __call__( request (~.firestore.RunQueryRequest): The request object. The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1942,7 +1925,7 @@ class _UpdateDocument(FirestoreRestStub): def __hash__(self): return hash("UpdateDocument") - __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, str] = {} + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} @classmethod def _get_unset_required_fields(cls, message_dict): @@ -1966,7 +1949,6 @@ def __call__( request (~.firestore.UpdateDocumentRequest): The request object. The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/cloud/firestore_v1/types/aggregation_result.py b/google/cloud/firestore_v1/types/aggregation_result.py index 492a602c11..33a5d84bb9 100644 --- a/google/cloud/firestore_v1/types/aggregation_result.py +++ b/google/cloud/firestore_v1/types/aggregation_result.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/types/common.py b/google/cloud/firestore_v1/types/common.py index 5170f191f6..f44881059b 100644 --- a/google/cloud/firestore_v1/types/common.py +++ b/google/cloud/firestore_v1/types/common.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/types/document.py b/google/cloud/firestore_v1/types/document.py index af564ab7db..a4e6946a4e 100644 --- a/google/cloud/firestore_v1/types/document.py +++ b/google/cloud/firestore_v1/types/document.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/types/firestore.py b/google/cloud/firestore_v1/types/firestore.py index 8fb2f486a2..6d3940cba2 100644 --- a/google/cloud/firestore_v1/types/firestore.py +++ b/google/cloud/firestore_v1/types/firestore.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/types/query.py b/google/cloud/firestore_v1/types/query.py index e2985be8ac..5d0080014f 100644 --- a/google/cloud/firestore_v1/types/query.py +++ b/google/cloud/firestore_v1/types/query.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/cloud/firestore_v1/types/write.py b/google/cloud/firestore_v1/types/write.py index 81542639af..ccd7a77ee1 100644 --- a/google/cloud/firestore_v1/types/write.py +++ b/google/cloud/firestore_v1/types/write.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/tests/unit/v1/test_base_document.py b/tests/unit/v1/test_base_document.py index b4ed2730f8..28fcc5b2a4 100644 --- a/tests/unit/v1/test_base_document.py +++ b/tests/unit/v1/test_base_document.py @@ -271,6 +271,7 @@ def test_documentsnapshot___eq___same_reference_same_data(): assert snapshot == other +@pytest.mark.xfail(strict=False) def test_documentsnapshot___hash__(): import datetime from proto.datetime_helpers import DatetimeWithNanoseconds