Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update cli table output #70

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions datachecks/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,34 @@ def _build_metric_cli_table(inspect_output: InspectOutput):
table = Table(
title="List of Generated Metrics", show_header=True, header_style="bold blue"
)
table.add_column("Data Source", justify="right", style="cyan", no_wrap=True)
table.add_column("Metric Name", style="cyan", no_wrap=True)
table.add_column("Data Source", style="magenta")
table.add_column("Metric Type", style="magenta")
table.add_column("Metric Identifier", style="magenta")
table.add_column("Value", justify="right", style="green")
for data_source_name, ds_metrics in inspect_output.metrics.items():
if isinstance(ds_metrics, DataSourceMetrics):
for tabel_name, table_metrics in ds_metrics.table_metrics.items():
for metric_identifier, metric in table_metrics.metrics.items():
table.add_row(
f"{metric.tags.get('metric_name')}",
f"{data_source_name}",
f"{metric.metric_type}",
f"{metric_identifier}",
f"{metric.value}",
)
for index_name, index_metrics in ds_metrics.index_metrics.items():
for metric_identifier, metric in index_metrics.metrics.items():
table.add_row(
f"{metric.tags.get('metric_name')}",
f"{data_source_name}",
f"{metric.metric_type}",
f"{metric_identifier}",
f"{metric.value}",
)
else:
for metric_identifier, metric in ds_metrics.metrics.items():
table.add_row(
f"{metric.tags.get('metric_name')}",
f"",
f"{metric.metric_type}",
f"{metric_identifier}",
f"{metric.value}",
)

Expand Down
Loading