Skip to content

feat: Pretty materialization - #62

Merged
CasperTeirlinck merged 3 commits into
mainfrom
pretty-materialization
Aug 28, 2026
Merged

feat: Pretty materialization#62
CasperTeirlinck merged 3 commits into
mainfrom
pretty-materialization

Conversation

@CasperTeirlinck

@CasperTeirlinck CasperTeirlinck commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

We use the console and markdown materializers often to present metrics directly to users (users use the CLI to print the results, and we also post the markdown table on PR's). While it is an easy way to iterate on the metrics like that, the presentation of these materializations can be improved imo.

For example we use a lot of boolean metrics as so called "healthchecks", which now show as 0 / 1 | boolean to the user. I'd like to propose a "pretty" flag to these materializers so they print for presentation to the users instead of the raw metric fields in table format (which remain ideal for machines).

The unit of a metric is a free text field on purpose, but the idea is that some well-known units deserve a nice presentation. For example:

  • "boolean": ✓/✗
  • "percent": %
  • more?

Summary

Changes to the ConsoleMaterializer and MarkdownMaterializer:

  • Add a Unit StrEnum with some well-know units (bool and percent atm) that are free to use when defining (custom) metrics.
  • Add a pretty flag to the 2 mentioned materializers that toggles special formatting depending on the unit.
  • Allow to select a subset of columns to show.

Some related changes:

  • Update the checkup.yaml a bit
  • Flipped some existing boolean metrics to be consistent in "1 is good" and "0 is bad"
  • Split up test files, it was 1 file of 1000 lines

Examples

You can put this in the checkup.yaml to set the default:

materializer:
  type: console
  pretty: true # <--

A basic checkup run in this repo now gives (see new defaults in the yaml:
image

or as before checkup run --materializer console:pretty=false:
image

But the effect gives better when you have healthcheck-type metrics that are all boolean:
image

versus without the pretty flag and column filter:

image

@CasperTeirlinck
CasperTeirlinck marked this pull request as ready for review August 28, 2026 12:45
@CasperTeirlinck
CasperTeirlinck merged commit 1b888c8 into main Aug 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants