plotly / plotly/dash

Show layout errors in devtools, not just "Error loading layout"

Open
#2,125 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dash-dev-tools feature P2
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

When using pd.Series with missing values encode as pandas.NA everything run fine however the web page display an error as html code (see img bellow).

I am not sure if this needs a fix I guess u are still waiting to implement support for pandas.NA but it would be helpful to get a python error on execution (which btw is already the case when invoking plotly.Figure show method).

Code to reproduce the bug

import pandas as pd

from plotly.express import line

from dash import Dash, html, dcc

df = pd.DataFrame([[1], [1, 4]], columns=['x', 'y'])
df['y'] = df.y.astype('UInt32')

fig = line(df, x='x',y='y')
fig = dcc.Graph(
    figure= fig
)
app = Dash(__name__)
app.layout = html.Div(children=fig)
app.run(debug=True)

My env

dash                               2.5.1
dash-core-components               2.0.0
dash-html-components               2.0.0
dash-table                         5.0.0
Capture d’écran 2022-07-10 à 16 17 49

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the supplied pandas.NA reproduction with app.run(debug=True), then trace how the layout containing dcc.Graph and html.Div reports errors. Compare this with the Plotly Figure.show behavior mentioned in the issue. Done means the underlying layout error is available in devtools instead of only showing “Error loading layout”.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
developer-experience, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.