Skip to content

Commit

Permalink
fix: time series render format (#1157)
Browse files Browse the repository at this point in the history
* fix: time series render format

* [skip ci] Code formatting

Co-authored-by: Azory YData Bot <[email protected]>
  • Loading branch information
2 people authored and aquemy committed Nov 22, 2022
1 parent 1ed2bc0 commit 39ca8ce
Showing 1 changed file with 14 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,34 @@ 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 39ca8ce

Please sign in to comment.