code: def test_sunburst_treemap_with_path_color():
      vendors = ["A", "B", "C", "D", "E", "F", "G", "H"]
      sectors = [
          "Tech",
          "Tech",
          "Finance",
          "Finance",
          "Tech",
          "Tech",
          "Finance",
          "Finance",
      ]
      regions = [
          "North",
          "North",
          "North",
          "North",
          "South",
          "South",
          "South",
          "South",
      ]
      values = [1, 3, 2, 4, 2, 2, 1, 4]
      calls = [8, 2, 1, 3, 2, 2, 4, 1]
      total = ["total"] * 8
      df = pd.DataFrame(
          dict(
              vendors=vendors,
              sectors=sectors,
              regions=regions,
              values=values,
              total=total,
              calls=calls,
          )
      )
      path = ["total", "regions", "sectors", "vendors"]
      fig = px.sunburst(df, path=path, values="values", color="calls")
      colors = fig.data[0].marker.colors
      assert np.all(np.array(colors[:8]) == np.array(calls))
      fig = px.sunburst(df, path=path, color="calls")
      colors = fig.data[0].marker.colors
      assert np.all(np.array(colors[:8]) == np.array(calls))
  
      # Hover info
      df["hover"] = [el.lower() for el in vendors]
      fig = px.sunburst(
          df, path=path, color="calls", hover_data=["hover"]
      )
      custom = fig.data[0].customdata
      assert np.all(custom[:8, 0] == df["hover"])
      assert np.all(custom[8:, 0] == "(?)")
      assert np.all(custom[:8, 1] == df["calls"])
  
      # Discrete color
      fig = px.sunburst(df, path=path, color="vendors")
      assert len(np.unique(fig.data[0].marker.colors)) == 9
  
      # Discrete color and color_discrete_map
      cmap = {"Tech": "yellow", "Finance": "magenta", "(?)": "black"}
      fig = px.sunburst(
          df, path=path, color="sectors", color_discrete_map=cmap
      )
      assert np.all(
          np.in1d(fig.data[0].marker.colors, list(cmap.values()))
      )
  
      # Numerical column in path
      df["regions"] = df["regions"].map({"North": 1, "South": 2})
      path = ["total", "regions", "sectors", "vendors"]
      fig = px.sunburst(df, path=path, values="values", color="calls")
      colors = fig.data[0].marker.colors
      assert np.all(np.array(colors[:8]) == np.array(calls))
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px_functions.py
imports: import plotly.express
  import plotly.graph_objects
  from numpy.testing import assert_array_equal
  import numpy
  import pandas
  import pytest
label_desc: Use image node_id 6 for calling a global function with example usage: test_sunburst_treemap_with_path_color() without return types