Skip to contents

Schema YAML is the single source of truth for canonical column types. crt_ingest() calls this after the registered handler returns, so every (source, file_name) pair gets type enforcement for free — handlers do not encode type knowledge.

Usage

crt_schema_apply(df, schema)

Arguments

df

A data frame returned by a registered handler.

schema

The parsed schema YAML (a list with canonical$cols).

Value

A tibble with columns coerced to canonical types.

Details

Reads canonical.cols[].type from the schema and coerces each named column to the declared type. Columns present in the data but absent from the schema's canonical.cols are left untouched. Columns absent from the data but declared in the schema are left to crt_schema_validate() to surface (this function does not validate presence — only type when the column exists).

Supported type values: