fill_defaults_from_pydantic

function of dascore.utils.pd source

fill_defaults_from_pydantic(
    df ,
    base_model: type[BaseModel] ,
)

Fill missing columns in dataframe with defaults from base_model.

If the missing column has no default value, raise ValueError.

Parameters

Parameter Description
df A dataframe
base_model A pydantic BaseModel