Skip to content

Commit

Permalink
fix: Support more Python sequence types when encoding to Protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Feb 20, 2020
1 parent 3a37ce9 commit 3cb7eb3
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 3cb7eb3

Please sign in to comment.