Schema Projections#
A Schema Projection defines a named exported schema from ordered steps.
Each step uses schema, kind, and names.
Registering a projection#
Use register_projection() to
register a projection, then
export_projection() to materialise
the projected pandera.DataFrameSchema.
catalog.register_projection(
"reporting_projection",
steps=[
{
"schema": "sensor_readings",
"kind": "columns",
"names": ["site", "sensor_id", "temperature"],
}
],
description="Columns used by reporting consumers",
)
projected = catalog.export_projection("reporting_projection")
print(list(projected.columns.keys()))
# ['site', 'sensor_id', 'temperature']
Validation behavior#
Unknown step kinds raise
ValueError.Unknown columns raise
ValueError.Duplicate projected columns across steps raise
ValueError.Missing schema references or duplicate projection names raise
KeyError.kind: groupis reserved for future support and currently raisesNotImplementedErrorduring registration.