code: def load_table(filetype, payload):
      df = (
          pd.read_csv(
              io.StringIO(base64.b64decode(payload).decode("utf-8"))
          )
          if filetype == "csv"
          else pd.read_excel(io.BytesIO(base64.b64decode(payload)))
      )
  
      return html.Div(
          DataTable(
              data=df.to_dict("records"),
              columns=[{"id": i} for i in ["city", "country"]],
          )
      )
  
file_path: dash/components/dash-core-components/tests/integration/upload/test_upload_different_file_types.py
imports: import io
  import base64
  import os
  import pytest
  import pandas
  from dash import Dash, Input, Output, dcc, html
  from dash.dash_table import DataTable
label_desc: Use image node_id 1 for calling a global function with example usage: load_table(filetype, payload) and returns: html