Metis — Check Viz Fit
check_viz_fitValidates whether a dataset can feed a saved visualization recipe with your proposed role-to-column mapping, reporting missing roles, nonexistent columns, unused fields, and caveats.
Instructions
Check that a dataset can feed a saved recipe. YOU propose the mapping.
The tool that makes "reproduce this with other data" a check rather than a
hunch — and it contains no cleverness on purpose. Reading that
`screening_mode` is the origin category in this dataset is semantics, which
is your job. Confirming that every role was accounted for, that each column
named actually exists, and that nothing was mapped which the recipe never
asked for is bookkeeping, which is this tool's job.
An earlier version guessed the mapping by comparing role names to column
names. It reported the same "0 matched" for a dataset built to fit and one
that could not fit at all, because roles are abstract precisely so they
carry no dataset's vocabulary. A check that cannot fail differently is
decoration, so it was removed.
Args:
recipe: viz_recipes.slug.
mapping: JSON object of role -> column in YOUR data, e.g.
'{"unit_id":"health_zone","start_class":"endemicity_2015",
"end_class":"endemicity_2025","group":"province"}'
columns: Optional comma-separated full column list. Supply it and the
check also catches a column you named that does not exist, plus
reports what is left unused.
Returns:
Ready or not-ready, what is missing, and the recipe's caveats — reprinted
here because the moment of use is when a caveat is actually read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| recipe | Yes | ||
| columns | No | ||
| mapping | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |