Skip to content

Errors when using pydantic v2.11.9 - Error creating ChangeEvent / Input should be a valid dictionary #24

@nchaigne

Description

@nchaigne

Hello,

I'm trying to use pypgoutput with PostgreSQSL 18 and Pydantic v2.11.9.
I get the following error from pypgoutput when receiving a logical replication event:

{'id': (<class 'int'>, Ellipsis)}
(...)Error extracting LR logs: Error creating ChangeEvent: 1 validation error for ChangeEvent
after
  Input should be a valid dictionary [type=dict_type, input_value=DynamicSchemaModel_16465(...4, 0, 23), value='test'), input_type=DynamicSchemaModel_16465]
    For further information visit https://errors.pydantic.dev/2.11/v/dict_type

From what I understand, Pydantic v2 introduced stricter validation rules (this worked with pydantic v1.10.4 on an older system).

ChangeEvent is supposed to receive a dict for "before" and "after", but it's receiving a dynamically generated model instance.
I'm not sure how to fix this.

Can you help ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions