Skip to content

ValidationError when listening to messages on aleph-sdk-python 0.6.0 #51

@MHHukiewitz

Description

@MHHukiewitz

The following error occurs when I start listening to Aleph messages with AlephClient.watch_messaages():

ValidationError(model='AggregateMessage', errors=[{'loc': ('_id',), 'msg': 'value is not a valid dict', 'type': 'type_error.dict'}])>
Traceback (most recent call last):
  File "/home/mik/PycharmProjects/yourtrading-ai/fishnet-cod/src/fishnet_cod/local_executor.py", line 50, in main
    await listen()
  File "/home/mik/PycharmProjects/yourtrading-ai/fishnet-cod/src/fishnet_cod/local_executor.py", line 37, in listen
    async for message in aars_client.session.watch_messages(
  File "/home/mik/PycharmProjects/yourtrading-ai/fishnet-cod/.venv/lib/python3.9/site-packages/aleph/sdk/client.py", line 812, in watch_messages
    yield Message(**data)
  File "/home/mik/PycharmProjects/yourtrading-ai/fishnet-cod/.venv/lib/python3.9/site-packages/aleph_message/models/__init__.py", line 333, in Message
    return message_class(**message_dict)
  File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for AggregateMessage
_id
  value is not a valid dict (type=type_error.dict)

It seems there are sometimes messages with _id or id_ fields when querying api2.aleph.im

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