Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve type information #176

Merged
merged 19 commits into from Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cf94a68
feat: improve type information
HemangChothani Aug 27, 2020
7e40d9d
feat: change some types
HemangChothani Aug 27, 2020
5466236
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Aug 28, 2020
4c4b24a
feat: rebase master branch
HemangChothani Aug 28, 2020
a9ea24f
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Sep 7, 2020
20c9748
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Sep 23, 2020
97cf89c
Merge branch 'master' into firestore_improve_type
tseaver Sep 24, 2020
b6b6a35
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Sep 24, 2020
f2b3c84
feat: change type hints
HemangChothani Sep 24, 2020
1aa2be2
Merge branch 'firestore_improve_type' of https://github.com/q-logic/p…
HemangChothani Sep 24, 2020
bb70a43
feat: remove coroutine type hints
HemangChothani Sep 24, 2020
4b2b6f0
fix: lint
HemangChothani Sep 24, 2020
be84506
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Sep 25, 2020
7d2755c
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Oct 7, 2020
49a1ca5
Merge branch 'master' of https://github.com/googleapis/python-firesto…
HemangChothani Oct 8, 2020
edae228
fix: resolve conflicts
HemangChothani Oct 13, 2020
c9bd198
fix: conflict resolved
HemangChothani Oct 22, 2020
9f015ec
fix: resolve attribute of writeoption
HemangChothani Oct 22, 2020
91dbcb6
fix: resolve commit
HemangChothani Oct 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions google/cloud/firestore_v1/_helpers.py
Expand Up @@ -34,9 +34,6 @@
from google.cloud.firestore_v1.types import write
from typing import Any, Generator, List, NoReturn, Optional, Tuple, Union

# Types needed only for Type Hints
from google.cloud.firestore_v1.document import DocumentReference

_EmptyDict: transforms.Sentinel
_GRPC_ERROR_MAPPING: dict

Expand Down Expand Up @@ -222,7 +219,7 @@ def encode_dict(values_dict) -> dict:
return {key: encode_value(value) for key, value in values_dict.items()}


def reference_value_to_document(reference_value, client) -> DocumentReference:
def reference_value_to_document(reference_value, client) -> Any:
tseaver marked this conversation as resolved.
Show resolved Hide resolved
"""Convert a reference value string to a document.

Args:
Expand Down
14 changes: 10 additions & 4 deletions google/cloud/firestore_v1/base_document.py
Expand Up @@ -224,7 +224,7 @@ def set(
def _prep_update(
self,
field_updates: dict,
option=None,
option: _helpers.WriteOption = None,
retry: retries.Retry = None,
timeout: float = None,
) -> Tuple[Any, dict]:
Expand All @@ -237,14 +237,17 @@ def _prep_update(
def update(
self,
field_updates: dict,
option=None,
option: _helpers.WriteOption = None,
retry: retries.Retry = None,
timeout: float = None,
) -> NoReturn:
raise NotImplementedError

def _prep_delete(
self, option=None, retry: retries.Retry = None, timeout: float = None,
self,
option: _helpers.WriteOption = None,
retry: retries.Retry = None,
timeout: float = None,
) -> Tuple[dict, dict]:
"""Shared setup for async/sync :meth:`delete`."""
write_pb = _helpers.pb_for_delete(self._document_path, option)
Expand All @@ -258,7 +261,10 @@ def _prep_delete(
return request, kwargs

def delete(
self, option=None, retry: retries.Retry = None, timeout: float = None,
self,
option: _helpers.WriteOption = None,
retry: retries.Retry = None,
timeout: float = None,
) -> NoReturn:
raise NotImplementedError

Expand Down
6 changes: 3 additions & 3 deletions google/cloud/firestore_v1/document.py
Expand Up @@ -131,7 +131,7 @@ def set(
def update(
self,
field_updates: dict,
option=None,
option: _helpers.WriteOption = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
) -> write.WriteResult:
Expand Down Expand Up @@ -287,7 +287,7 @@ def update(

def delete(
self,
option=None,
option: _helpers.WriteOption = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
timeout: float = None,
) -> timestamp_pb2.Timestamp:
Expand Down Expand Up @@ -341,7 +341,7 @@ def get(
transaction (Optional[:class:`~google.cloud.firestore_v1.transaction.Transaction`]):
An existing transaction that this reference
will be retrieved in.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry.Retry): Designation of what errors, if an y,
should be retried. Defaults to a system-specified policy.
timeout (float): The timeout for this request. Defaults to a
system-specified value.
Expand Down