question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't warn on empty layouts

See original GitHub issue

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Python version      :  3.6.7 | packaged by conda-forge | (default, Nov 20 2018, 18:37:09)
IPython version     :  7.2.0
Tornado version     :  5.1.1
Bokeh version       :  1.1.0dev9+2.g1138433
BokehJS static path :  /Users/jsignell/conda/envs/bokeh-dev/lib/python3.6/site-packages/bokeh-1.1.0.dev9+2.g1138433-py3.6.egg/bokeh/server/static
node.js version     :  v11.6.0
npm version         :  6.5.0

Description of expected behavior and the observed behavior

I think that layouts should be allowed to be empty without raising a warning. There is a legitimate use of an empty layout object to create an empty area which can later be appended to or extended. This is especially useful in panel (see issue: https://github.com/pyviz/panel/issues/285) where the layout object will re-render if the children change.

I understand that it could potentially be confusing if someone were to create an empty layout object and then think that it is just not rendering - but it doesn’t seem like that would be terribly common (if it has been in the past, then maybe this warning shouldn’t be removed).

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.io import output_notebook, show
from bokeh.layouts import column
from bokeh.models.widgets import Button

output_notebook()

col = column([])
show(col)

warning will be displayed

# add a button
button = Button(label='Click me!')
col.children.append(button)
show(col)

column will render properly

Stack traceback and/or browser JavaScript console output

This is the relevant warning:

https://github.com/bokeh/bokeh/blob/113843391ae24a685c12f04bc57cb2404df56155/bokeh/core/validation/warnings.py#L13-L14

Screenshots or screencasts of the bug in action

This is the warning:

screen shot 2019-03-07 at 8 57 03 am

And this is the column rendering properly after adding an item to it: screen shot 2019-03-07 at 8 58 31 am

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
mattpapcommented, Mar 7, 2019

This is something that was carried over from the old layout. I will remove this warning.

0reactions
bryevdvcommented, Mar 11, 2019

The crux of the matter is that I strongly suspect that the number of people legitimately intending to show an empty layout is minuscule [1] compared to a much greater occurrence of people unintentionally showing an empty layout by mistake, left wondering why they are staring at an empty screen with no guidance or feedback. In which case we are optimizing for the wrong (uncommon) case.

[1] Case in point, it is basically never useful to show an empty layout for any standalone, non-server case, because there is no way to update and add anything after the fact. Most usage (“standard” notebook usage, HTML file output, components or json_items embedding) is non-server.

Edit: then perhaps there is the compromise: we don’t warn in the context of server apps, but we do warn always for other usage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I delete warning message W-1002(EMPTY_LAYOUT ...
But I want to delete this warning. Someone helps me. alarm info. WARNING:bokeh.core.validation.check:W-1002 (EMPTY_LAYOUT): Layout has no ...
Read more >
After updating to bokeh 1.2 I am experiencing several ...
I have just upgraded to bokeh 1.2 and my bokeh app stopped working giving me the following error and showing just a blank...
Read more >
Layout files—ArcGIS Pro | Documentation
Layout files can either contain map frames and elements that reference maps and layers, or contain empty map frames that don't reference maps...
Read more >
Fields Not Empty Script Check
I know I can set each field not to be empty, but when you click outside of the field, it shows a warning...
Read more >
Tableau "No Data to Display" Warning Message
Where there once was a bar graph in the dashboard layout structure, there is now nothing, and that's why the filters have moved...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found