Set Customize Discrete Color to Plotly Graph Objects

Hi everyone, I’m new to plotly, I have two different plots below (go.Pie & go.Bar) and I like to assign a color to each type (a - g) label as shown in the color_discrete_map. How do I include them in the codes for go.pie & Thanks you very much!


    color_discrete_map = {'a':'rgb(42,9,4)', 
    unit_mix_pie.add_trace(go.Pie(labels=df.index, values=df['type']), row=1, col=1)

unit_mix_bar.add_trace(go.Bar(x=df.index, y=round(df['type'],0), marker=dict(
        color=px.colors.qualitative.Pastel2, color_discrete_map=color_discrete_map,
        line=dict(color='#000000', width=2)
    )), row=1, col=1)