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

Silence EMPTY_LAYOUT warnings #4056

Merged
merged 2 commits into from
Oct 25, 2022
Merged

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Oct 25, 2022

The EMPTY_LAYOUT warning is emitted when an empty layout (e.g. pn.Row()) is rendered. Panel use cases are different than Bokeh's ones, Panel is more used to serve interactive apps where it's perfectly valid to render an empty layout that is later populated with some content. In this case this warning is just noise.

The ability to silence specific Bokeh warnings was added to Bokeh a few years ago bokeh/bokeh#8739. This PR is using the silence function to silence this warning, for both panel serve and pn.serve() usages.

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Merging #4056 (f5b5e6c) into master (f083d88) will increase coverage by 0.00%.
The diff coverage is 92.30%.

@@           Coverage Diff           @@
##           master    #4056   +/-   ##
=======================================
  Coverage   83.54%   83.54%           
=======================================
  Files         223      223           
  Lines       33193    33219   +26     
=======================================
+ Hits        27730    27754   +24     
- Misses       5463     5465    +2     
Flag Coverage Δ
ui-tests 37.57% <30.76%> (-0.02%) ⬇️
unitexamples-tests 74.56% <92.30%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/tests/test_server.py 99.44% <88.88%> (-0.37%) ⬇️
panel/command/serve.py 35.74% <100.00%> (+1.39%) ⬆️
panel/io/server.py 75.09% <100.00%> (+0.14%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mattpap
Copy link
Collaborator

mattpap commented Oct 25, 2022

I would prefer to remove that warning (even as soon as now, i.e. 3.0). I always found it annoying that we warn about a perfectly valid behavior, which is counter productive at best.

@maximlt
Copy link
Member Author

maximlt commented Oct 25, 2022

I've seen a rather long discussion on Bokeh about this warning, with some being in favor of removing it, and some being in favor of keeping it, but that was some years ago so opinions may have changed!

@mattpap
Copy link
Collaborator

mattpap commented Oct 25, 2022

Here's bokeh/bokeh#8725 the discussion. I will submit a PR.

@philippjfr
Copy link
Member

Still going to merge this but thankfully we can then remove it again on the 3.0 branch.

@philippjfr philippjfr merged commit c2933d3 into master Oct 25, 2022
@philippjfr philippjfr deleted the silence_empty_layout_warning branch October 25, 2022 09:04
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 this pull request may close these issues.

None yet

3 participants