The default behavior of Plotly's error bars is to show them when the error is 0 or NaN for that point. When using a bar chart, this results in a flat error bar at the top of the bar.
import plotly.express as px
import pandas as pd
data = pd.DataFrame([1, 2, 3])
sem = pd.DataFrame({'a': [math.nan, math.nan, math.nan]})
# sem = pd.DataFrame({'a': [0, 0, 0]}) # same behavior
px.bar(
data,
error_y=sem['a']
)
This results in a plot like this, with the error bars.

Is it possible to remove the error bars from points where the corresponding value of the error_y dataframe is 0 or NaN?
For context, in my particular case each bar represents an average. I do not want to show any bars when the average was "calculated" from one point as to not be misleading.
