
Apply a schema's canonical type declarations to handler output
Source:R/crt_schema_apply.R
crt_schema_apply.RdSchema 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.
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:
integer->as.integer()double->as.double()string->as.character()(handles readr's Date / POSIXct auto-parsing for columns the schema declares as text)logical->as.logical()