Skip to content

Bug: Schema class creation should fail if nullable primary key is declared #160

@DeflateAwning

Description

@DeflateAwning
        class _HouseSchema(dy.Schema):
            zip_code = dy.String(primary_key=True, nullable=True)
            num_bedrooms = dy.UInt8(nullable=False)
            num_bathrooms = dy.UInt8(nullable=False)
            price = dy.Float64(nullable=False)

Per the new primary key documentation, creating a nullable primary key (e.g., zip_code column in this example) should fail immediately.

I think this would be a AnnotationImplementationError exception. Would be awesome to add a unit test to ensure this fails. I think it should fail during dy.Column() constructor execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions