From a07a1c66b2535e675370d7c77ce075fce2234f4a Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 29 May 2024 18:03:54 -0700 Subject: [PATCH] Update the CLI to use corresponding methods for the data table. --- dbt-metricflow/dbt_metricflow/cli/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt-metricflow/dbt_metricflow/cli/main.py b/dbt-metricflow/dbt_metricflow/cli/main.py index 71afb1ddd3..0308965e14 100644 --- a/dbt-metricflow/dbt_metricflow/cli/main.py +++ b/dbt-metricflow/dbt_metricflow/cli/main.py @@ -334,14 +334,14 @@ def query( df = query_result.result_df # Show the data if returned successfully if df is not None: - if df.empty: + if df.row_count == 0: click.echo("🕳 Successful MQL query returned an empty result set.") elif csv is not None: # csv is a LazyFile that is file-like that works in this case. df.to_csv(csv, index=False) # type: ignore click.echo(f"🖨 Successfully written query output to {csv.name}") else: - click.echo(df.to_markdown(index=False, floatfmt=f".{decimals}f")) + click.echo(df.text_format(decimals)) if display_plans: temp_path = tempfile.mkdtemp()