code: def test_pivot_df_no_cols_no_rows_single_metric():
      """
      Pivot table when no cols/rows and 1 metric are selected.
      """
      # when no cols/rows are selected there are no groupbys in the query,
      # and the data has only the metric(s)
      df = pd.DataFrame.from_dict({"SUM(num)": {0: 80679663}})
      assert (
          df.to_markdown()
          == """
  |    |    SUM(num) |
  |---:|------------:|
  |  0 | 8.06797e+07 |
      """.strip()
      )
  
      pivoted = pivot_df(
          df,
          rows=[],
          columns=[],
          metrics=["SUM(num)"],
          aggfunc="Sum",
          transpose_pivot=False,
          combine_metrics=False,
          show_rows_total=False,
          show_columns_total=False,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                  |   ('SUM(num)',) |
  |:-----------------|----------------:|
  | ('{_("Total")} (Sum)',) |     8.06797e+07 |
      """.strip()
      )
  
      # transpose_pivot and combine_metrics do nothing in this case
      pivoted = pivot_df(
          df,
          rows=[],
          columns=[],
          metrics=["SUM(num)"],
          aggfunc="Sum",
          transpose_pivot=True,
          combine_metrics=True,
          show_rows_total=False,
          show_columns_total=False,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                  |   ('SUM(num)',) |
  |:-----------------|----------------:|
  | ('{_("Total")} (Sum)',) |     8.06797e+07 |
      """.strip()
      )
  
      # apply_metrics_on_rows will pivot the table, moving the metrics
      # to rows
      pivoted = pivot_df(
          df,
          rows=[],
          columns=[],
          metrics=["SUM(num)"],
          aggfunc="Sum",
          transpose_pivot=True,
          combine_metrics=True,
          show_rows_total=False,
          show_columns_total=False,
          apply_metrics_on_rows=True,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |               |   ('{_("Total")} (Sum)',) |
  |:--------------|-------------------:|
  | ('SUM(num)',) |        8.06797e+07 |
      """.strip()
      )
  
      # showing totals
      pivoted = pivot_df(
          df,
          rows=[],
          columns=[],
          metrics=["SUM(num)"],
          aggfunc="Sum",
          transpose_pivot=True,
          combine_metrics=True,
          show_rows_total=True,
          show_columns_total=True,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                  |   ('SUM(num)',) |   ('Total (Sum)',) |
  |:-----------------|----------------:|-------------------:|
  | ('{_("Total")} (Sum)',) |     8.06797e+07 |        8.06797e+07 |
      """.strip()
      )
  
imports: import pandas
  import pytest
  from flask_babel import lazy_gettext
  from numpy import True_
  from sqlalchemy.orm.session import Session
  from superset.charts.post_processing import apply_post_process, pivot_df, table
  from superset.common.chart_data import ChartDataResultFormat
  from superset.utils.core import GenericDataType
label_desc: Use image node_id 1 for calling a global function with example usage: test_pivot_df_no_cols_no_rows_single_metric() without return types