An upgrade broke datatables for my environment, and I haven't been able to undo the break even after rolling back the update, completely uninstalling python and starting from scratch, etc. Any app with a datatable is failing with the following error:
Dash Version 0.35.2
Dash DataTable Version 3.2.0
Dash Core Components Version 0.43.0
Dash HTML Components Version 0.13.5
Pandas Version 0.24.0
Numpy Version 1.16.1
Plotly Version 3.5.0
cx_Oracle Version 12.2.0.1.0
Traceback
(most recent call last):
File "C:\Users\david\.spyder-py3\dataagg_Test_001.py", line 73, in <module>
data=dataaggrun.to_dict("rows"),
File "C:\Users\david\AppData\Roaming\Python\Python37\site-packages\dash\dash\dash.py", line 279, in layout
''
dash.dash.exceptions.NoLayoutException: Layout must be a dash component or a function that returns a dash component.
It appears to be looking for a layout component, but none is require for a datatable. I downgraded back to my original versions, but the issue persists. My simplified code is below:
import dash
import dash_table
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import numpy as np
import plotly
import cx_Oracle
#... some stuff here
#Retrieve DATAAGGRUN records
dataaggrunhist where processname = \'DATA AGGREGATION\' and status = \'COMPLETE\') order by dataaggrunid desc'
dataaggrun_query = 'select * from dataaggrun where dataaggrunid =4 order by dataaggrunid desc'
dataaggrun = pd.read_sql(dataaggrun_query, con= db)
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([
html.Div(id='dataaggrun-table-container'),
dash_table.DataTable(
id='dataaggrun-table',
columns=[
{"name": i, "id": i} for i in dataaggrun.columns
],
data=dataaggrun.to_dict("rows"),
),
])
if __name__ == '__main__':
app.run_server(debug=True)
The code from the dash.py file being referenced is below:
@layout.setter
def layout(self, value):
if (not isinstance(value, Component) and
not isinstance(value, collections.Callable)):
raise exceptions.NoLayoutException(
''
'Layout must be a dash component '
'or a function that returns '
'a dash component.')