Skip to content

Unable to generate pydantic-core schema for <class 'memoryview'> #55

Open
@sbking

Description

@sbking

When generating a pydantic model that includes a BYTEA column in postgres, it has a memoryview attribute that causes this error:

pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'memoryview'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

Should it be bytes instead?

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