Repository navigation
Closed
Closed
Copy link
Description
The example below throws an error in 6.0.0rc0 but not in 5.24.1
raise ValueError(
ValueError:
Invalid value of type 'builtins.dict' received for the 'x' property of scatter
Received value: {'dtype': 'i2', 'bdata': 'oAelB6oHrwe0B7kHvgfDB8gHzQfSB9cH'}
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
from dash import Dash, dcc, html
import plotly.express as px
import copy
app = Dash(__name__)
gapminder = px.data.gapminder().query("(country=='Canada') | (country=='United States') | (country=='Mexico')")
fig = px.line(gapminder, x="year", y="gdpPercap", color='country')
fig.update_yaxes(title_text='Year')
fig.update_xaxes(title_text='Adoption Rate')
# Default dimensions
fig.update_layout(
margin=dict(l=60, r=0, t=0, b=60),
)
fig_custom_height = copy.deepcopy(fig)
fig_custom_height.update_layout(height=800)
fig_custom_short_height = copy.deepcopy(fig)
fig_custom_short_height.update_layout(height=200)
app.layout = [
dcc.Graph(
figure = fig_custom_height,
),
dcc.Graph(
figure = fig_custom_short_height,
),
]
if __name__ == '__main__':
app.run_server(debug=True)
pip list output:
Package Version
-------------------- -----------
blinker 1.9.0
certifi 2024.8.30
charset-normalizer 3.4.0
click 8.1.7
dash 2.18.2
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0
Flask 3.0.3
idna 3.10
importlib_metadata 8.5.0
itsdangerous 2.2.0
Jinja2 3.1.4
MarkupSafe 3.0.2
narwhals 1.15.2
nest-asyncio 1.6.0
numpy 2.1.3
packaging 24.2
pandas 2.2.3
pip 23.2.1
plotly 6.0.0rc0
python-dateutil 2.9.0.post0
pytz 2024.2
requests 2.32.3
retrying 1.3.4
setuptools 65.5.0
six 1.16.0
tenacity 9.0.0
typing_extensions 4.12.2
tzdata 2024.2
urllib3 2.2.3
Werkzeug 3.0.6
zipp 3.21.0
Activity
FBruzzesi commentedon Dec 3, 2024
I was able to bisect it to the following commit: 960adb9
Specifically
is_typed_array_specwas the only function checking for dict type.marthacryan commentedon Dec 3, 2024
@FBruzzesi Thank you for finding that! I think we can put those changes back in. I was not expecting the typed arrays to be input to validators anymore but I see that this is a case where they might be showing up for validation. If we bypass validation when we encounter typed array spec it should work, so maybe I'll just revert those changes.
FBruzzesi commentedon Dec 3, 2024
I am running tests reverting those changes! I can open a PR if everything goes smooth :)
Edit: I wonder if there are specific tests worth adding
gvwilson commentedon Dec 9, 2024
@marthacryan @FBruzzesi what's the status on this one now? thanks - @gvwilson
marthacryan commentedon Dec 9, 2024
I approved the PR to fix this! @gvwilson should I go ahead and merge?
gvwilson commentedon Dec 9, 2024
please!