Skip to content

guarantee record type invariance? #3

@mphelp

Description

@mphelp

@joshlk

This package provides an effective way to create pandas dataframes from data that fits a dataclass. Thanks for writing it.

I saw this comment which echoed something I thought too: https://github.com/joshlk/dataclassframe/blob/main/dataclassframe/dataclassframe_.py#L93

i.e. should the underlying dataframe records type/schema always be the exact same dataclass? I tried the package myself and can easily add a column to the dataframe when using dataclassframe.

My suggestion would be to either force this behavior OR provide an optional "record_class_frozen" to the DataClassFrame constructor.

NOTE: I know in general python doesn’t have runtime type checking, so I’m not sure how this would be enforced

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