Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MarcSkovMadsen opened this issue Oct 27, 2023 · 0 comments · May be fixed by #7639
Open

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

MarcSkovMadsen opened this issue Oct 27, 2023 · 0 comments · May be fixed by #7639
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

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.

@MarcSkovMadsen MarcSkovMadsen added TRIAGE Default label for untriaged issues type: bug and removed TRIAGE Default label for untriaged issues labels Oct 27, 2023
@MarcSkovMadsen MarcSkovMadsen added this to the next milestone Oct 27, 2023
@philippjfr philippjfr modified the milestones: next, v1.6.0 Jan 20, 2025
@philippjfr philippjfr linked a pull request Jan 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants