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
It only looks for the children prop to determine this and the DataTable doesn't have a children prop. You can workaround this by looking at bool(tb.data) instead.
Would it be reasonable to add an explicit __bool__ for components that’s always True? That could be useful for cases where a variable might be a component or might be None.
Activity
T4rk1n commentedon Jul 4, 2024
The condition for components is based on it's
__len__property,dash/dash/development/base_component.py
Lines 369 to 389 in 1cb7455
It only looks for the children prop to determine this and the DataTable doesn't have a
childrenprop. You can workaround this by looking atbool(tb.data)instead.alexcjohnson commentedon Jul 5, 2024
Would it be reasonable to add an explicit
__bool__for components that’s alwaysTrue? That could be useful for cases where a variable might be a component or might beNone.JakkuSakura commentedon Jul 8, 2024
Yeah it would be helpful
JakkuSakura commentedon Jul 8, 2024
bool(tb.data) it's not a direct replacement of bool(tb), as it might be None and raise None value exception
[-][BUG] bool(DashTable) is always False[/-][+]bool(DashTable) is always False[/+]