I have working code old older Bokeh/Python versions and am trying to update using Bokeh 2.2.3 and Python 3.8.
When I try to patch a DataSource i get the error:
TypeError: ‘tuple’ object does not support item assignment
Please see sample below…
ceokey = ‘CTX:David Reeves’
print(type(ds))
idx = sectorsource.data[‘ceo’].index(ceokey)
patches = {‘color’ : }
save_colour = sectorsource.data[‘color’][idx]
patches[‘color’].append((idx, ‘#471568’))
print(‘Patches:’,patches[‘color’])
ds.patch(patches)
This trips as follows:…
TypeError Traceback (most recent call last)
in
9 print(‘Patches:’,patches[‘color’])
10
—> 11 ds.patch(patches)
~/opt/anaconda3/lib/python3.8/site-packages/bokeh/models/sources.py in patch(self, patches, setter)
682 raise ValueError(“Invalid patch index: %s” % ind)
683
→ 684 self.data._patch(self.document, self, patches, setter)
685
686 class CDSView(Model):
~/opt/anaconda3/lib/python3.8/site-packages/bokeh/core/property/wrappers.py in _patch(self, doc, source, patches, setter)
461 for ind, value in patch:
462 if isinstance(ind, (int, slice)):
→ 463 self[name][ind] = value
464 else:
465 shape = self[name][ind[0]][tuple(ind[1:])].shape
TypeError: ‘tuple’ object does not support item assignment
Has anyone else seen this?