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: support more Python sequence types when encoding to Protobuf #21

Merged
Merged
Changes from all commits
Commits
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
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