DocumentSnapshot
timestamp fields broken by proto-plus
#398
Labels
api: firestore
Issues related to the googleapis/python-firestore API.
type: question
Request for information or clarification. Not an issue.
We document that
DocumentSnapshot.{read_time,create_time,update_time}
are of typegoogle.protobuf.timestamp_pb2.Timestamp
, and the current implementation ofDocumentSnapshot.__hash__
expects that to be true. However, the use ofproto-plus
by the microgenerator means that those attributes are now actually being populated with instances ofproto.datetime_helpers.DatetimeWithNanoseconds
: this discrepancy is the source of #391.Fixing this is tricky: there may be code out there which has adapted to the change in actual type for those attributes. We basically have several choices:
DocumentSnapshot
ctor to forcibly convert back to theTimestamp
(ick).DocumentSnapshot
instances to use the_pb
version, passingTimestamp
messages intoDocumentSnapshot
.__hash__
accordingly.Any of these choices may involve tweaking e.g. the conformance tests, the
firefox_bundle
code, etc., to match.@crwilcox, @craiglabenz WDYT?
The text was updated successfully, but these errors were encountered: