DeserializationError after upgrade from 0.12.11 to 0.12.13

Hi everyone,

as my problem is not very specific yet, I wanted to post it here first (instead of github).

After the upgrade from 0.12.11 to 0.12.13, I get a new error:

error handling message Message ‘PATCH-DOC’ (revision 1): DeserializationError(“Seq(Any) expected a list or None, got {#a dict that shows indizes and values of one column in my ColumnDataSource#}”,)

``

The weird part: My program works just fine!

Also I have trouble pinning down the origin of the error.

I have a CheckboxButtonGroup representing categories in my data that allows me to filter the data in my plots.

After calculating the filters I do:

# Create a new ColumnDataSource object from the filtered DataFrame
source_new = ColumnDataSource(data=DatEx.df[filter_combined])
print('Test 1')

# Update the "data" property of the "source" object with the new data.
DatEx.source.data = source_new.data
print('Test 2')

``

After that, nothing else happens until the user presses another button.

However, the error message appears AFTER ‘Test 1’ and ‘Test 2’ are printed.

Any advice on how to proceed?

Regards

Hi,

Without a complete example to run and investigate it's hard to say but I will mention this: The .data attribute of a CDS looks like a plain dict, but it's actually a specially instrumented wrapper to automatically detect and respond to changes. In general you should assign to .data from a real, plain, regular python dict, and not from the .data of an other CDS. i.e you should do this:

  source.data = regular_python_dict

and NOT do what you are doing, which is:

  source.data = some_other_source.data

That may or may not be the case of the issue, a minimal complete reproducer would be needed to dig further.

Thanks,

Bryan

···

On Dec 14, 2017, at 02:12, Joris Nettelstroth <[email protected]> wrote:

Hi everyone,

as my problem is not very specific yet, I wanted to post it here first (instead of github).

After the upgrade from 0.12.11 to 0.12.13, I get a new error:
error handling message Message 'PATCH-DOC' (revision 1): DeserializationError("Seq(Any) expected a list or None, got {#a dict that shows indizes and values of one column in my ColumnDataSource#}",)

The weird part: My program works just fine!
Also I have trouble pinning down the origin of the error.

I have a CheckboxButtonGroup representing categories in my data that allows me to filter the data in my plots.
After calculating the filters I do:
    # Create a new ColumnDataSource object from the filtered DataFrame
    source_new = ColumnDataSource(data=DatEx.df[filter_combined])
    print('Test 1')

    # Update the "data" property of the "source" object with the new data.
    DatEx.source.data = source_new.data
    print('Test 2')

After that, nothing else happens until the user presses another button.
However, the error message appears AFTER 'Test 1' and 'Test 2' are printed.

Any advice on how to proceed?
Regards

--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/832554c9-0d3e-4673-b654-934355db5dcd%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks a lot Bryan, you are great!

I am happy to not need a minimal reproducer, because that would have been quite a pain. Instead, you already solved the issue.

The solution was:

source.data = df[filter_combined].to_dict(‘list’)

``

The following two did not work:

source.data = df[filter_combined].to_dict(‘dict’)

source.data = df[filter_combined].to_dict()

``

So I guess 0.12.13 has become stricter about how things are handled… thanks again!

···

Am Donnerstag, 14. Dezember 2017 18:57:19 UTC+1 schrieb Bryan Van de ven:

Hi,

Without a complete example to run and investigate it’s hard to say but I will mention this: The .data attribute of a CDS looks like a plain dict, but it’s actually a specially instrumented wrapper to automatically detect and respond to changes. In general you should assign to .data from a real, plain, regular python dict, and not from the .data of an other CDS. i.e you should do this:

    source.data = regular_python_dict

and NOT do what you are doing, which is:

    source.data = some_other_source.data

That may or may not be the case of the issue, a minimal complete reproducer would be needed to dig further.

Thanks,

Bryan

On Dec 14, 2017, at 02:12, Joris Nettelstroth [email protected] wrote:

Hi everyone,

as my problem is not very specific yet, I wanted to post it here first (instead of github).

After the upgrade from 0.12.11 to 0.12.13, I get a new error:

error handling message Message ‘PATCH-DOC’ (revision 1): DeserializationError(“Seq(Any) expected a list or None, got {#a dict that shows indizes and values of one column in my ColumnDataSource#}”,)

The weird part: My program works just fine!

Also I have trouble pinning down the origin of the error.

I have a CheckboxButtonGroup representing categories in my data that allows me to filter the data in my plots.

After calculating the filters I do:

# Create a new ColumnDataSource object from the filtered DataFrame
source_new = ColumnDataSource(data=DatEx.df[filter_combined])
print('Test 1')
# Update the "data" property of the "source" object with the new data.
DatEx.source.data = source_new.data
print('Test 2')

After that, nothing else happens until the user presses another button.

However, the error message appears AFTER ‘Test 1’ and ‘Test 2’ are printed.

Any advice on how to proceed?

Regards


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 [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/832554c9-0d3e-4673-b654-934355db5dcd%40continuum.io.

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

Uh… by the way: There really should be a “solved” tag for these posts!

···

Am Donnerstag, 14. Dezember 2017 19:47:34 UTC+1 schrieb Joris Nettelstroth:

Thanks a lot Bryan, you are great!

I am happy to not need a minimal reproducer, because that would have been quite a pain. Instead, you already solved the issue.

The solution was:

source.data = df[filter_combined].to_dict(‘list’)

``

The following two did not work:

source.data = df[filter_combined].to_dict(‘dict’)

source.data = df[filter_combined].to_dict()

``

So I guess 0.12.13 has become stricter about how things are handled… thanks again!

Am Donnerstag, 14. Dezember 2017 18:57:19 UTC+1 schrieb Bryan Van de ven:

Hi,

Without a complete example to run and investigate it’s hard to say but I will mention this: The .data attribute of a CDS looks like a plain dict, but it’s actually a specially instrumented wrapper to automatically detect and respond to changes. In general you should assign to .data from a real, plain, regular python dict, and not from the .data of an other CDS. i.e you should do this:

    source.data = regular_python_dict

and NOT do what you are doing, which is:

    source.data = some_other_source.data

That may or may not be the case of the issue, a minimal complete reproducer would be needed to dig further.

Thanks,

Bryan

On Dec 14, 2017, at 02:12, Joris Nettelstroth [email protected] wrote:

Hi everyone,

as my problem is not very specific yet, I wanted to post it here first (instead of github).

After the upgrade from 0.12.11 to 0.12.13, I get a new error:

error handling message Message ‘PATCH-DOC’ (revision 1): DeserializationError(“Seq(Any) expected a list or None, got {#a dict that shows indizes and values of one column in my ColumnDataSource#}”,)

The weird part: My program works just fine!

Also I have trouble pinning down the origin of the error.

I have a CheckboxButtonGroup representing categories in my data that allows me to filter the data in my plots.

After calculating the filters I do:

# Create a new ColumnDataSource object from the filtered DataFrame
source_new = ColumnDataSource(data=DatEx.df[filter_combined])
print('Test 1')
# Update the "data" property of the "source" object with the new data.
DatEx.source.data = source_new.data
print('Test 2')

After that, nothing else happens until the user presses another button.

However, the error message appears AFTER ‘Test 1’ and ‘Test 2’ are printed.

Any advice on how to proceed?

Regards


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 [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/832554c9-0d3e-4673-b654-934355db5dcd%40continuum.io.

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