bool(DashTable) is always False
Open
Nobody has claimed this yet.
bug
feature
P3
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
Describe your context
dash 2.17.1
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0
Describe the bug
bool(DashTable) is always False. I can't use tb or [] for shorthand when there is no data
from dash import dash_table
df = pd.DataFrame({'a': [1, 2]})
tb = dash_table.DataTable(df.to_dict('records'), columns=[{'name': column, 'id': column} for column in df.columns])
print(bool(tb))
Expected behavior
bool(tb) evaluates to True, either always or when there is data
Screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported behavior with dash_table.DataTable and the versions listed in the issue, using the provided DataFrame example. Check how DataTable is evaluated by bool() and confirm that the result matches the expected behavior when the table contains data; done means the example no longer evaluates unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100