Skip to content

Commit

Permalink
fix: time series render format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarros committed Nov 21, 2022
1 parent c9850c2 commit 06b915e
Showing 1 changed file with 12 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,32 @@ def render_timeseries(config: Settings, summary: dict) -> dict:
[
{
"name": "Distinct",
"value": summary["n_distinct"],
"fmt": fmt,
"value": fmt(summary["n_distinct"]),
"alert": "n_distinct" in summary["alert_fields"],
},
{
"name": "Distinct (%)",
"value": summary["p_distinct"],
"fmt": fmt_percent,
"value": fmt_percent(summary["p_distinct"]),
"alert": "p_distinct" in summary["alert_fields"],
},
{
"name": "Missing",
"value": summary["n_missing"],
"fmt": fmt,
"value": fmt(summary["n_missing"]),
"alert": "n_missing" in summary["alert_fields"],
},
{
"name": "Missing (%)",
"value": summary["p_missing"],
"fmt": fmt_percent,
"value": fmt_percent(summary["p_missing"]),
"alert": "p_missing" in summary["alert_fields"],
},
{
"name": "Infinite",
"value": summary["n_infinite"],
"fmt": fmt,
"value": fmt(summary["n_infinite"]),
"alert": "n_infinite" in summary["alert_fields"],
},
{
"name": "Infinite (%)",
"value": summary["p_infinite"],
"fmt": fmt_percent,
"value": fmt_percent(summary["p_infinite"]),
"alert": "p_infinite" in summary["alert_fields"],
},
],
Expand All @@ -79,38 +73,32 @@ def render_timeseries(config: Settings, summary: dict) -> dict:
[
{
"name": "Mean",
"value": summary["mean"],
"fmt": fmt_numeric,
"value": fmt_numeric(summary["mean"], precision=config.report.precision),
"alert": False,
},
{
"name": "Minimum",
"value": summary["min"],
"fmt": fmt_numeric,
"value": fmt_numeric(summary["min"], precision=config.report.precision),
"alert": False,
},
{
"name": "Maximum",
"value": summary["max"],
"fmt": fmt_numeric,
"value": fmt_numeric(summary["max"], precision=config.report.precision),
"alert": False,
},
{
"name": "Zeros",
"value": summary["n_zeros"],
"fmt": fmt,
"value": fmt(summary["n_zeros"]),
"alert": "n_zeros" in summary["alert_fields"],
},
{
"name": "Zeros (%)",
"value": summary["p_zeros"],
"fmt": fmt_percent,
"value": fmt_percent(summary["p_zeros"]),
"alert": "p_zeros" in summary["alert_fields"],
},
{
"name": "Memory size",
"value": summary["memory_size"],
"fmt": fmt_bytesize,
"value": fmt_bytesize(summary["memory_size"]),
"alert": False,
},
],
Expand Down

0 comments on commit 06b915e

Please sign in to comment.