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

Bug while using ProtoList with builtin type #3

@nitoqq

Description

@nitoqq

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions