You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
One of the main principles of the DataClassFrame is that it's column wise immutable i.e. the schema should not change including the type. So I would like to enforce this as much as possible.
Currently it's quite easy to break this principle by manipulating the underlying DataFrame data (the .df attribute) but there is no way I can prevent that. Could you provide some examples of how you changed the schema of a DataClassFrame?
@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
The text was updated successfully, but these errors were encountered: