The idea is to change the hover template only in the "Resto" trace. Here is a reproducible example:
df_stack = pd.DataFrame({"Country": ['Brasil','China','Estados unidos','Chile','India','Paises bajos','Vietnam','Peru','Corea, republica de','Indonesia','Resto'],
"Dolars": [11599.42961799,7671.6791054099995,6198.81430321,4578.07,4153.13352132,3352.11349841,2998.44092833,2247.29957849,1968.7549113200002,1890.7284090800001,35635.107780379985],
"Pct_change":[0.0846110761489467,0.2953716769009316,0.41561413372310074,0.21787800280514857,0.09245460739576772,0.18325289020293622,0.023857445957433443,0.2555960957383905,0.2319776811635097,0.12068329801455069,0.0]
})
fig = go.Figure(data=[go.Pie(labels=df_stack["Country"], values=df_stack['Dolars'], hole=.5,
customdata = np.transpose([df_stack["Pct_change"],
]),
hovertemplate="<b>%{label}</b> <br>Dolars: $%{value:,.2f}"
"<br>Percent: %{percent:.1%}"
"<br>Pct_change: %{customdata[0]:.1%}"
"<br<extra></extra>>",
)])
fig.update_layout(title_text = f"Change hover of specific trace in pie chart", template = None, font_family = "verdana",
margin = dict(t=70, l=10, r=10, b=30), separators = ",.",
showlegend= False,)
fig.update_traces(hovertemplate=None, selector=dict(name = 'Resto')) #It won't work!!!
Unlike with Scatter traces, the last line of code won't do the trick.
fig.update_traces(hovertemplate=None, selector=dict(name = 'Resto')) #It won't work!!!