☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

What's the trick to updating the rows in a table?

Community Support
Jim_Sharpe
Jim_Sharpe

We used to have this working, but something changed over the past couple of months and we now can’t seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).

The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.

I’m sure it’s probably something obvious but can’t seem to figure out what I’m missing or doing wrong. Is there some trick to updating the contents of a table after it’s been shown in a notebook?

table_update_test.ipynb (20.2 KB)

⌁   Link to post
Bryan
Bryan

Jim,

There are two things. One is that it the data table is not added to the "current document" automatically the way it happens with "figure", "vplot", etc. This part of the API is a bit muddled, and we are currently working on making it better. In the mean time, the upshot is just that you need to add the table to the document explicitly:

  curdoc().add_root(bokehTable)

The other like the plumbing to change .source is not hooked up completely, but changing source.data is, so use:

  bokehTable.source.data = {'AAA' : [8, 9, 10, 11], 'BBB' : [11, 21, 31, 41],'CCC' : [201,51,-31,-51]}

Or or the equivalent, basically: update the existing source, don't replace it.

With these changes, I see the table update.

Thanks,

Bryan

···

On May 6, 2016, at 6:02 PM, Jim Sharpe <jms@sharpe.com> wrote:

We used to have this working, but something changed over the past couple of months and we now can't seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).

The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.

I'm sure it's probably something obvious but can't seem to figure out what I'm missing or doing wrong. Is there some trick to updating the contents of a table after it's been shown in a notebook?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f76ad540-2a17-4a80-91f4-c5e70f0bef82%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<table_update_test.ipynb>

⌁   Link to post
Bryan
Bryan

As a corollary, can you make a GH issue with all this info so we can track the "replace the source" case and schedule work to fix it at some point. That would be very helpful!

Thanks,

Bryan

···

On May 7, 2016, at 12:07 PM, Bryan Van de Ven <bryan@bokeh.org> wrote:

Jim,

There are two things. One is that it the data table is not added to the "current document" automatically the way it happens with "figure", "vplot", etc. This part of the API is a bit muddled, and we are currently working on making it better. In the mean time, the upshot is just that you need to add the table to the document explicitly:

  curdoc().add_root(bokehTable)

The other like the plumbing to change .source is not hooked up completely, but changing source.data is, so use:

  bokehTable.source.data = {'AAA' : [8, 9, 10, 11], 'BBB' : [11, 21, 31, 41],'CCC' : [201,51,-31,-51]}

Or or the equivalent, basically: update the existing source, don't replace it.

With these changes, I see the table update.

Thanks,

Bryan

On May 6, 2016, at 6:02 PM, Jim Sharpe <jms@sharpe.com> wrote:

We used to have this working, but something changed over the past couple of months and we now can't seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).

The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.

I'm sure it's probably something obvious but can't seem to figure out what I'm missing or doing wrong. Is there some trick to updating the contents of a table after it's been shown in a notebook?

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f76ad540-2a17-4a80-91f4-c5e70f0bef82%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
<table_update_test.ipynb>

⌁   Link to post
Jim_Sharpe
Jim_Sharpe

Hi Bryan,

Thanks for the very prompt reply. After reading your solution I do now recall the need to set source.data directly rather than just changing the source. And had actually tried that, which is why that commented out line was in the example notebook. The part I was missing was registering the table with curdoc.

A while back I opened GH issue #3564 about getting a selected row after a column sort. It appears that overall topic might actually be the same as this one in that it’s related to source handling for tables. Do you think that’s the case or should I still open a new issue?

···

On Saturday, May 7, 2016 at 5:07:17 AM UTC-6, Bryan Van de ven wrote:

Jim,

There are two things. One is that it the data table is not added to the “current document” automatically the way it happens with “figure”, “vplot”, etc. This part of the API is a bit muddled, and we are currently working on making it better. In the mean time, the upshot is just that you need to add the table to the document explicitly:

    curdoc().add_root(bokehTable)

The other like the plumbing to change .source is not hooked up completely, but changing source.data is, so use:

    bokehTable.source.data = {'AAA' : [8, 9, 10, 11], 'BBB' : [11, 21, 31, 41],'CCC' : [201,51,-31,-51]}

Or or the equivalent, basically: update the existing source, don’t replace it.

With these changes, I see the table update.

Thanks,

Bryan

On May 6, 2016, at 6:02 PM, Jim Sharpe j...@sharpe.com wrote:

We used to have this working, but something changed over the past couple of months and we now can’t seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).

The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.

I’m sure it’s probably something obvious but can’t seem to figure out what I’m missing or doing wrong. Is there some trick to updating the contents of a table after it’s been shown in a notebook?

–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f76ad540-2a17-4a80-91f4-c5e70f0bef82%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<table_update_test.ipynb>

⌁   Link to post
Bryan
Bryan

From a quick re-look at that, I think this is a separate issue.

Bryan

···

On May 7, 2016, at 2:37 PM, Jim Sharpe <jms@sharpe.com> wrote:

Hi Bryan,

Thanks for the very prompt reply. After reading your solution I do now recall the need to set source.data directly rather than just changing the source. And had actually tried that, which is why that commented out line was in the example notebook. The part I was missing was registering the table with curdoc.

A while back I opened GH issue #3564 about getting a selected row after a column sort. It appears that overall topic might actually be the same as this one in that it's related to source handling for tables. Do you think that's the case or should I still open a new issue?

On Saturday, May 7, 2016 at 5:07:17 AM UTC-6, Bryan Van de ven wrote:
Jim,

There are two things. One is that it the data table is not added to the "current document" automatically the way it happens with "figure", "vplot", etc. This part of the API is a bit muddled, and we are currently working on making it better. In the mean time, the upshot is just that you need to add the table to the document explicitly:

        curdoc().add_root(bokehTable)

The other like the plumbing to change .source is not hooked up completely, but changing source.data is, so use:

        bokehTable.source.data = {'AAA' : [8, 9, 10, 11], 'BBB' : [11, 21, 31, 41],'CCC' : [201,51,-31,-51]}

Or or the equivalent, basically: update the existing source, don't replace it.

With these changes, I see the table update.

Thanks,

Bryan

> On May 6, 2016, at 6:02 PM, Jim Sharpe <j...@sharpe.com> wrote:
>
> We used to have this working, but something changed over the past couple of months and we now can't seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).
>
> The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.
>
> I'm sure it's probably something obvious but can't seem to figure out what I'm missing or doing wrong. Is there some trick to updating the contents of a table after it's been shown in a notebook?
>
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f76ad540-2a17-4a80-91f4-c5e70f0bef82%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
> <table_update_test.ipynb>

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e42788ea-3078-4aba-8268-c46c6fa4df8c%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post
Jim_Sharpe
Jim_Sharpe

issue #4294 has been created for tracking

···

On Saturday, May 7, 2016 at 5:11:14 AM UTC-6, Bryan Van de ven wrote:

As a corollary, can you make a GH issue with all this info so we can track the “replace the source” case and schedule work to fix it at some point. That would be very helpful!

Thanks,

Bryan

On May 7, 2016, at 12:07 PM, Bryan Van de Ven bry...@continuum.io wrote:

Jim,

There are two things. One is that it the data table is not added to the “current document” automatically the way it happens with “figure”, “vplot”, etc. This part of the API is a bit muddled, and we are currently working on making it better. In the mean time, the upshot is just that you need to add the table to the document explicitly:

    curdoc().add_root(bokehTable)

The other like the plumbing to change .source is not hooked up completely, but changing source.data is, so use:

    bokehTable.source.data = {'AAA' : [8, 9, 10, 11], 'BBB' : [11, 21, 31, 41],'CCC' : [201,51,-31,-51]}

Or or the equivalent, basically: update the existing source, don’t replace it.

With these changes, I see the table update.

Thanks,

Bryan

On May 6, 2016, at 6:02 PM, Jim Sharpe j...@sharpe.com wrote:

We used to have this working, but something changed over the past couple of months and we now can’t seem to be able to update the rows in a table ( bokeh version: 0.12.0dev1 running in a notebook).

The attached example notebook is a simple test case that first creates and displays a table. It then changes the source for the table and calls push_notebook, but nothing happens. However if we show the table again it does reflect the changes in the new copy.

I’m sure it’s probably something obvious but can’t seem to figure out what I’m missing or doing wrong. Is there some trick to updating the contents of a table after it’s been shown in a notebook?

–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f76ad540-2a17-4a80-91f4-c5e70f0bef82%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

<table_update_test.ipynb>

⌁   Link to post

End of archived discussion · Replies are disabled