Skip to content

pn.Param: value doesn't have a value set #5751

@MarcSkovMadsen

Description

@MarcSkovMadsen

I'm on Panel 1.3.0 and Param 2.0 trying to refresh my understanding of the Location object https://panel.holoviz.org/how_to/state/url.html

When I try to create a small app from the example I get bokeh.core.property.descriptors.UnsetValueError: Slider(id='p1105', ...).value doesn't have a value set.

import param import panel as pn class QueryExample(param.Parameterized): integer = param.Integer(default=None, bounds=(0, 10)) string = param.String(default='A string') query_example = QueryExample() pn.state.location.sync(QueryExample(), {'integer': 'int', 'string': 'str'}) pn.Param(query_example).servable()
 File "/home/jovyan/repos/my-repo/.venv/lib/python3.10/site-packages/bokeh/core/has_props.py", line 599, in properties_with_values return self.query_properties_with_values(lambda prop: prop.serialized, File "/home/jovyan/repos/my-repo/.venv/lib/python3.10/site-packages/bokeh/core/has_props.py", line 656, in query_properties_with_values value = descriptor.get_value(self) File "/home/jovyan/repos/my-repo/.venv/lib/python3.10/site-packages/bokeh/core/property/descriptors.py", line 394, in get_value return self.__get__(obj, obj.__class__) File "/home/jovyan/repos/my-repo/.venv/lib/python3.10/site-packages/bokeh/core/property/descriptors.py", line 283, in __get__ raise UnsetValueError(f"{obj}.{self.name} doesn't have a value set") bokeh.core.property.descriptors.UnsetValueError: Slider(id='p1105', ...).value doesn't have a value set

If I change the integer value to 1 the example works.

I believe this is a bug and that pn.Param should pick another widget to support the None value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions