CDCgov / cfa-immunization-uptake-projection

Apache License 2.0
1 stars 0 forks source link

Consistent method of enforcing polars subclass #42

Open eschrom opened 3 days ago

eschrom commented 3 days ago

Subclasses of a polars data frame (any UptakeData, e.g.) will revert to regular polars data frame after a polars operation (e.g. filter, with_columns, rename, etc.). We can make versions of these polars functions that return the subclass they were given, or we can coerce polars data frames into subclasses more frequently (i.e. UptakeData(df)). Choose a strategy and be consistent.

swo commented 1 day ago

I lean toward option 2 (let data frames be data frames, and use the subclasses for explicit validation or when we need extra functionality)