Skip to content

Commit

Permalink
fix: Support more Python sequence types when encoding to Protobuf (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed May 29, 2020
1 parent 777d0e3 commit b1c5987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google/cloud/firestore_v1/_helpers.py
Expand Up @@ -186,8 +186,8 @@ def encode_value(value):
if isinstance(value, GeoPoint):
return document_pb2.Value(geo_point_value=value.to_protobuf())

if isinstance(value, list):
value_list = [encode_value(element) for element in value]
if isinstance(value, (list, tuple, set, frozenset)):
value_list = tuple(encode_value(element) for element in value)
value_pb = document_pb2.ArrayValue(values=value_list)
return document_pb2.Value(array_value=value_pb)

Expand Down

0 comments on commit b1c5987

Please sign in to comment.