Px.timeline - How to combine multiple Gantt timelines into single figure?

Goal: To combine 2 timelines together
Issue: add_traces() does NOT render ‘colors’ key for second timeline, just a single color

I can properly create the 1st timeline with no issues; however, adding the 2nd has been challenging. There’s very little guidance online explicitly on px.timeline – help would be really appreciated, in terms of what’s ‘best practice’ when combining px. timelines.

import plotly.express as px
import plotly.graph_objects as go

purpose = px.timeline(timeline, x_start='START', x_end='END', y=timeline.index, color='PURPOSE')
source = px.timeline(timeline, x_start='START', x_end='END', y=timeline.index, color='SQLsource')

fig = go.Figure(purpose)
fig.add_trace(source.data[0])
#fig.layout = source.layout --------- doesn't seem to change anything?

Legend shows single discrete variable from my 2nd timeline, ‘CSR Form’ — the former all belong to the 1st timeline.

This is a bit speculative, but I believe px.timeline is, under the hood, implemented as calls to go.Bar, so you might get somewhere with

fig.add_trace(go.Bar(...))

I don’t know of any doc, but you can get some insight of how it’s working by looking at the source code (plotly.py/packages/python/plotly/plotly/express/_core.py at master · plotly/plotly.py · GitHub), at the definition of process_data_timeline() (around line 1750) which converts the px.timeline() args to go.Bar() args, and the call to that function (around line 2097)