code: def get_chart_dataframe(
      chart_url: str, auth_cookies: Optional[dict[str, str]] = None
  ) -> Optional[pd.DataFrame]:
      # Disable all the unnecessary-lambda violations in this function
      # pylint: disable=unnecessary-lambda
      content = get_chart_csv_data(chart_url, auth_cookies)
      if content is None:
          return None
  
      result = simplejson.loads(content.decode("utf-8"))
      # need to convert float value to string to show full long number
      pd.set_option("display.float_format", lambda x: str(x))
      df = pd.DataFrame.from_dict(result["result"][0]["data"])
  
      if df.empty:
          return None
  
      try:
          # if any column type is equal to 2, need to convert data into
          # datetime timestamp for that column.
          if (
              GenericDataType.TEMPORAL
              in result["result"][0]["coltypes"]
          ):
              for i in range(len(result["result"][0]["coltypes"])):
                  if (
                      result["result"][0]["coltypes"][i]
                      == GenericDataType.TEMPORAL
                  ):
                      df[result["result"][0]["colnames"][i]] = df[
                          result["result"][0]["colnames"][i]
                      ].astype("datetime64[ms]")
      except BaseException as err:
          logger.error(err)
  
      # rebuild hierarchical columns and index
      df.columns = pd.MultiIndex.from_tuples(
          tuple(colname) if isinstance(colname, list) else (colname,)
          for colname in result["result"][0]["colnames"]
      )
      df.index = pd.MultiIndex.from_tuples(
          tuple(indexname)
          if isinstance(indexname, list)
          else (indexname,)
          for indexname in result["result"][0]["indexnames"]
      )
      return df
  
file_path: superset/superset/utils/csv.py
imports: import logging
  import re
  import urllib.request
  from typing import Any, Optional, Union
  from urllib.error import URLError
  import numpy
  import pandas
  import simplejson
  from superset.utils.core import GenericDataType
label_desc: Use image node_id 4 for calling a global function with example usage: get_chart_dataframe(chart_url, auth_cookies) and returns: df, None, None