Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Regression going from Dash 0.39 to 0.40 -- implicit 0 child is missing from app #148

Closed
Marc-Andre-Rivet opened this issue Apr 10, 2019 · 0 comments
Labels
Meta: Regression Type: Bug Something isn't working as intended

Comments

@Marc-Andre-Rivet
Copy link
Contributor

Marc-Andre-Rivet commented Apr 10, 2019

Note the difference in the last table.

Code

import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd

df = pd.read_csv(
    'https://gist.githubusercontent.com/chriddyp/'
    'c78bf172206ce24f77d6363a2d754b59/raw/'
    'c353e8ef842413cae56ae3920b8fd78468aa4cb2/'
    'usa-agricultural-exports-2011.csv')


def generate_table(dataframe, max_rows=10):
    return html.Div([
        html.Table(
            # Header
            [html.Tr([html.Th(col) for col in dataframe.columns])] +

            # Body
            [html.Tr([
                html.Td(children=[dataframe.iloc[i][col]]) for col in dataframe.columns
            ]) for i in range(min(len(dataframe), max_rows))]
        ),
        html.Table(
            # Header
            [html.Tr([html.Th(col) for col in dataframe.columns])] +

            # Body
            [html.Tr([
                html.Td([dataframe.iloc[i][col]]) for col in dataframe.columns
            ]) for i in range(min(len(dataframe), max_rows))]
        ),
        html.Table(
            # Header
            [html.Tr([html.Th(col) for col in dataframe.columns])] +

            # Body
            [html.Tr([
                html.Td(dataframe.iloc[i][col]) for col in dataframe.columns
            ]) for i in range(min(len(dataframe), max_rows))]
        )
    ])

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div(children=[
    html.H4(children='US Agriculture Exports (2011)'),
    generate_table(df, 5)
])

if __name__ == "__main__":
    app.run_server(port=8070)

Dash 0.39
image

Dash 0.40
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Meta: Regression Type: Bug Something isn't working as intended
Projects
None yet
Development

No branches or pull requests

1 participant