mercator
mercator copied to clipboard
Bug while using ProtoList with builtin type
Example
class SomeMessage(ProtoMapping):
__proto__ = api_pb2.SomeMessage
array_of_integers = ProtoList('array_of_integers', int)
SomeMessage({'array_of_integers': (1, 2, 3)}).to_protobuf()
there's an error raised
ERROR grpc._server:_server.py:444 Exception calling application: int() argument must be a string, a bytes-like object or a number, not 'tuple' while casting "(1, 2, 3)" (tuple) to int
Traceback (most recent call last):
File ".../src/mercator/mercator/meta.py", line 53, in cast
return self.target_type(value)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'tuple'