Skip to content

Commit

Permalink
Handle decimal type
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-zk committed Apr 15, 2024
1 parent 5f71145 commit f40fd47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion streetlevel/streetview/protobuf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Some code to deal with the URL-encoded protobuf Google uses in Maps.
from enum import Enum

from decimal import Decimal

class ProtobufType(Enum):
"""
Expand Down Expand Up @@ -88,6 +88,8 @@ def _get_datatype_str(value):
datatype = ProtobufType.INT
elif isinstance(value, float):
datatype = ProtobufType.DOUBLE
elif isinstance(value, Decimal):
datatype = ProtobufType.DOUBLE
elif isinstance(value, dict):
datatype = ProtobufType.MESSAGE
else:
Expand Down

0 comments on commit f40fd47

Please sign in to comment.