You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of expected behavior and the observed behavior
Panel._compute_sizing_mode is not gracefully handling if margin is set as None in the passed props.
Complete, minimal, self-contained example code that reproduces the issue
I am struggling to make a MRE for this as this quirk/bug surfaced after some seemingly innocuous changes to other parts of a larger Panel application I'm working on. I cannot seem to track down exactly why the margin is being set to None with the pn.Row that is causing this.
I'm hoping that adding a check to make sure the margin is not None in this function is easy enough without tracking down the root cause though I also would love to get to the bottom of why the margin in the passed props to this function would ever be None.
Confirmed that self.margin has a value of 0, but that the passed props has margin of None which is preferred here:
File "/python/lib/python3.10/site-packages/panel/layout/base.py", line 511, in pop
self.objects = new_objects
File "/python/lib/python3.10/site-packages/param/parameterized.py", line 525, in _f
instance_param.__set__(obj, val)
File "/python/lib/python3.10/site-packages/param/parameterized.py", line 527, in _f
return f(self, obj, val)
File "/python/lib/python3.10/site-packages/param/parameterized.py", line 1545, in __set__
obj.param._call_watcher(watcher, event)
File "/python/lib/python3.10/site-packages/param/parameterized.py", line 2486, in _call_watcher
self_._execute_watcher(watcher, (event,))
File "/python/lib/python3.10/site-packages/param/parameterized.py", line 2468, in _execute_watcher
watcher.fn(*args, **kwargs)
File "/python/lib/python3.10/site-packages/panel/reactive.py", line 374, in _param_change
self._apply_update(named_events, properties, model, ref)
File "/python/lib/python3.10/site-packages/panel/reactive.py", line 302, in _apply_update
self._update_model(events, msg, root, model, doc, comm)
File "/python/lib/python3.10/site-packages/panel/layout/base.py", line 99, in _update_model
msg.update(self._compute_sizing_mode(
File "/python/lib/python3.10/site-packages/panel/layout/base.py", line 241, in _compute_sizing_mode
width += margin*2
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
Screenshots or screencasts of the bug in action
I may be interested in making a pull request to address this
My current solution is to just monkey patch Panel._compute_sizing_mode with:
@banesullivan-kobold Thanks for tracking this down, I'd love to get the fix for this into the 1.3.8 release I'm planning for today. If you get a chance today I'd love to see a PR, but if you're in a time crunch I plan to make a PR myself and then release it.
ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
Description of expected behavior and the observed behavior
Panel._compute_sizing_mode
is not gracefully handling ifmargin
is set asNone
in the passedprops
.Complete, minimal, self-contained example code that reproduces the issue
I am struggling to make a MRE for this as this quirk/bug surfaced after some seemingly innocuous changes to other parts of a larger Panel application I'm working on. I cannot seem to track down exactly why the margin is being set to
None
with thepn.Row
that is causing this.I'm hoping that adding a check to make sure the margin is not
None
in this function is easy enough without tracking down the root cause though I also would love to get to the bottom of why themargin
in the passedprops
to this function would ever beNone
.Confirmed that
self.margin
has a value of0
, but that the passedprops
hasmargin
ofNone
which is preferred here:panel/panel/layout/base.py
Line 212 in 075b5ae
Stack traceback and/or browser JavaScript console output
Screenshots or screencasts of the bug in action
My current solution is to just monkey patch
Panel._compute_sizing_mode
with:(in my app, I actually apply the entire function copy/pasted to ensure this is thread safe, but the above is the spirit of it)
The text was updated successfully, but these errors were encountered: