-
-
Notifications
You must be signed in to change notification settings - Fork 0
Schema Specification
Praveen Kumar edited this page Jul 11, 2026
·
2 revisions
A target schema describes the shape you want after cleaning. It is optional but recommended for production pipelines.
See examples/customer.schema.yaml:
name: customer
columns:
customer_name:
dtype: string
required: true
aliases: ["Customer Name", "Cust Name"]
signup_date:
dtype: date
required: true
date_formats: ["%d/%m/%Y", "%Y-%m-%d"]
amount_inr:
dtype: float
required: true
min: 0
email:
dtype: email
required: true
phone:
dtype: phone| Field | Meaning |
|---|---|
dtype |
Logical type: string, integer, float, boolean, date, datetime, email, phone, url, category, … |
required |
Synthesise not_null validation |
unique |
Synthesise unique validation |
min / max
|
Numeric bounds → comparison checks |
allowed_values |
Category membership check |
date_formats |
Hint preferred parse formats |
aliases |
Alternate source names for mapping |
cleanframe infer-schema data.csv -o schema.yamlschema = cf.infer_schema(df, name="customer")
schema.save("customer.schema.yaml")Always review inferred schemas before committing — especially allowed_values
and date formats.
- schema_mapping detector proposes renames from messy → canonical names
- Planner synthesises validations from constraints / semantic types
- Confidence still gates inclusion by
mode