Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Bug while using ProtoList with builtin type #3

Open
nitoqq opened this issue Nov 20, 2019 · 0 comments
Open

Bug while using ProtoList with builtin type #3

nitoqq opened this issue Nov 20, 2019 · 0 comments

Comments

@nitoqq
Copy link

nitoqq commented Nov 20, 2019

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'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant