New warning in panel 0.13.1 --param function

Hi, I have been using panel to build a large scale multi page app. To achieve the multi page aspect I have been using tabs combined with param functions so as to defer the load of the page until the tab is selected, as is showing in an example in the documentation page. Tabs — Panel v0.13.1

After updating to 0.13.1 I get the following warning

WARNING:param.Function 1: The function ‘func1’ does not have any dependencies and will never update. Are you sure you did not intend to depend on or bind a parameter or widget to this function? If not simply call the function before passing it to Panel. Otherwise, when passing a parameter as an argument, ensure you pass at least one parameter and reference the actual parameter object not the current value, i.e. use object.param.parameter not object.parameter.

Here is a MRE:

I would like to understand this further to make sure that my production level code isn’t going to encounter any problems down the track.

UPDATE: This warning is now reflected in the Tabs documentation, but not explained.

1 Like

Hi @bazdiddly88 !

Thanks for this example, this does indeed look like a small bug, this warning has just been added to prevent users from binding a function without any Parameter, i.e. pn.panel(pn.bind(foo)) as the function foo would in this case just be called once on render while the user intention would likely be to attach it to some Parameters.

It seems like we’ve not accounted for the case where ParamMethod or ParamFunction are used directly in a tab as your example, in lazy mode. Could you please open an issue on Panel?

(I’m curious about your multi page app, could you say more about it?)

1 Like