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
In order to avoid printing empty panels and tables, we should have a utility function that checks if a renderable is empty, and if so print a message like "No data..." or something similar.
In the case of tables, we could simply check the Table.row_count attribute to check if the table has any rows. For Panels, we would have to check every renderable inside the panel, probably recursively in case the panel contains another panel or group.
Something like:
defis_empty(renderable: RenderableType) ->bool:
"""Check if a renderable is empty."""ifisinstance(renderable, Table):
returnrenderable.row_count<=0elifisinstance(renderable, Panel):
returnis_empty(renderable.renderable)
elifisinstance(renderable, Group):
forchildinrenderable.children:
ifnotis_empty(child):
returnFalseelse:
returnFalsereturnTrue
Although it would probably turn out to be quite a bit more complex than this in practice.
The text was updated successfully, but these errors were encountered:
In order to avoid printing empty panels and tables, we should have a utility function that checks if a renderable is empty, and if so print a message like
"No data..."
or something similar.In the case of tables, we could simply check the
Table.row_count
attribute to check if the table has any rows. For Panels, we would have to check every renderable inside the panel, probably recursively in case the panel contains another panel or group.Something like:
Although it would probably turn out to be quite a bit more complex than this in practice.
The text was updated successfully, but these errors were encountered: