code: def test_pivot_df_single_row_two_metrics():
      """
      Pivot table when a single column and 2 metrics are selected.
      """
      df = pd.DataFrame.from_dict(
          {
              "gender": {0: "girl", 1: "boy"},
              "SUM(num)": {0: 118065, 1: 47123},
              "MAX(num)": {0: 2588, 1: 1280},
          }
      )
      assert (
          df.to_markdown()
          == """
  |    | gender   |   SUM(num) |   MAX(num) |
  |---:|:---------|-----------:|-----------:|
  |  0 | girl     |     118065 |       2588 |
  |  1 | boy      |      47123 |       1280 |
      """.strip()
      )
  
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(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()
          == """
  |           |   ('SUM(num)',) |   ('MAX(num)',) |
  |:----------|----------------:|----------------:|
  | ('boy',)  |           47123 |            1280 |
  | ('girl',) |          118065 |            2588 |
      """.strip()
      )
  
      # transpose_pivot
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(num)"],
          aggfunc="Sum",
          transpose_pivot=True,
          combine_metrics=False,
          show_rows_total=False,
          show_columns_total=False,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                  |   ('SUM(num)', 'boy') |   ('SUM(num)', 'girl') |   ('MAX(num)', 'boy') |   ('MAX(num)', 'girl') |
  |:-----------------|----------------------:|-----------------------:|----------------------:|-----------------------:|
  | ('{_("Total")} (Sum)',) |                 47123 |                 118065 |                  1280 |                   2588 |
      """.strip()
      )
  
      # combine_metrics does nothing in this case
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(num)"],
          aggfunc="Sum",
          transpose_pivot=False,
          combine_metrics=True,
          show_rows_total=False,
          show_columns_total=False,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == """
  |           |   ('SUM(num)',) |   ('MAX(num)',) |
  |:----------|----------------:|----------------:|
  | ('boy',)  |           47123 |            1280 |
  | ('girl',) |          118065 |            2588 |
      """.strip()
      )
  
      # show totals
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(num)"],
          aggfunc="Sum",
          transpose_pivot=False,
          combine_metrics=False,
          show_rows_total=True,
          show_columns_total=True,
          apply_metrics_on_rows=False,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                  |   ('SUM(num)',) |   ('MAX(num)',) |   ('{_("Total")} (Sum)',) |
  |:-----------------|----------------:|----------------:|-------------------:|
  | ('boy',)         |           47123 |            1280 |              48403 |
  | ('girl',)        |          118065 |            2588 |             120653 |
  | ('{_("Total")} (Sum)',) |          165188 |            3868 |             169056 |
      """.strip()
      )
  
      # apply_metrics_on_rows
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(num)"],
          aggfunc="Sum",
          transpose_pivot=False,
          combine_metrics=False,
          show_rows_total=True,
          show_columns_total=True,
          apply_metrics_on_rows=True,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                          |   ('{_("Total")} (Sum)',) |
  |:-------------------------|-------------------:|
  | ('SUM(num)', 'boy')      |              47123 |
  | ('SUM(num)', 'girl')     |             118065 |
  | ('SUM(num)', 'Subtotal') |             165188 |
  | ('MAX(num)', 'boy')      |               1280 |
  | ('MAX(num)', 'girl')     |               2588 |
  | ('MAX(num)', 'Subtotal') |               3868 |
  | ('{_("Total")} (Sum)', '')      |             169056 |
      """.strip()
      )
  
      # apply_metrics_on_rows with combine_metrics
      pivoted = pivot_df(
          df,
          rows=["gender"],
          columns=[],
          metrics=["SUM(num)", "MAX(num)"],
          aggfunc="Sum",
          transpose_pivot=False,
          combine_metrics=True,
          show_rows_total=True,
          show_columns_total=True,
          apply_metrics_on_rows=True,
      )
      assert (
          pivoted.to_markdown()
          == f"""
  |                      |   ('{_("Total")} (Sum)',) |
  |:---------------------|-------------------:|
  | ('boy', 'SUM(num)')  |              47123 |
  | ('boy', 'MAX(num)')  |               1280 |
  | ('boy', 'Subtotal')  |              48403 |
  | ('girl', 'SUM(num)') |             118065 |
  | ('girl', 'MAX(num)') |               2588 |
  | ('girl', 'Subtotal') |             120653 |
  | ('{_("Total")} (Sum)', '')  |             169056 |
      """.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 3 for calling a global function with example usage: test_pivot_df_single_row_two_metrics() without return types