Skip to main content

SchemaInfo

Schema-derived context handed to Step.fit().

Usage

Source

SchemaInfo(
    columns=None, dtypes=None, roles=None, lineage=None, producing_steps=None
)

Carries the current column names, their dtype names, and the live Roles. In practice a step reads only roles (for selector resolution). The recipe-side column-lineage DAG (mlfeatures.lineage.Lineage) is maintained separately by the recipe and is not handed to steps for their own logic; lineage and producing_steps are populated by the recipe purely so provenance selectors (has_source / has_ancestor) can resolve against the DAG at fit time. Both are None outside a recipe fit. Not to be confused with ColSchema (what a step reports back) or Schema (the snapshot of the training data used for boundary checks).

Examples

Build a snapshot from a data frame with from_frame; steps read columns, dtypes, and roles off it during fit():

frame = _frame.from_native(pd.DataFrame({"x": [1, 2], "y": ["a", "b"]}))
info = SchemaInfo.from_frame(frame)
info.columns, info.dtypes
(['x', 'y'], {'x': 'Int64', 'y': 'String'})