diff --git a/google/cloud/firestore_v1/document.py b/google/cloud/firestore_v1/document.py index 548d902574..a4cb15a78b 100644 --- a/google/cloud/firestore_v1/document.py +++ b/google/cloud/firestore_v1/document.py @@ -593,8 +593,11 @@ def __eq__(self, other): return self._reference == other._reference and self._data == other._data def __hash__(self): - seconds = self.update_time.seconds - nanos = self.update_time.nanos + # TODO(microgen): maybe add datetime_with_nanos to protoplus, revisit + # seconds = self.update_time.seconds + # nanos = self.update_time.nanos + seconds = self.update_time.second + nanos = 0 return hash(self._reference) + hash(seconds) + hash(nanos) @property diff --git a/google/cloud/firestore_v1/watch.py b/google/cloud/firestore_v1/watch.py index fe6fce45d6..148abc609c 100644 --- a/google/cloud/firestore_v1/watch.py +++ b/google/cloud/firestore_v1/watch.py @@ -221,7 +221,7 @@ def __init__( ResumableBidiRpc = self.ResumableBidiRpc # FBO unit tests self._rpc = ResumableBidiRpc( - self._api.transport.listen, + self._api._transport.listen, should_recover=_should_recover, should_terminate=_should_terminate, initial_request=rpc_request, @@ -261,6 +261,9 @@ def __init__( def _get_rpc_request(self): if self.resume_token is not None: self._targets["resume_token"] = self.resume_token + + self._targets["query"] = self._targets["query"]._pb + return firestore.ListenRequest( database=self._firestore._database_string, add_target=self._targets ) @@ -570,7 +573,9 @@ def push(self, read_time, next_resume_token): self._snapshot_callback( keys, appliedChanges, - datetime.datetime.fromtimestamp(read_time.seconds, pytz.utc), + read_time + # TODO(microgen): now a datetime + # datetime.datetime.fromtimestamp(read_time.seconds, pytz.utc), ) self.has_pushed = True