Skip to content

Parsing Dash initial_arguments broken in v1.6.1 #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gabegrand opened this issue Mar 15, 2021 · 9 comments
Closed

Parsing Dash initial_arguments broken in v1.6.1 #328

gabegrand opened this issue Mar 15, 2021 · 9 comments

Comments

@gabegrand
Copy link

I've identified a regression in release 1.6.1 that causes a bug when parsing initial_arguments as a serialized string.

We have an app that uses initial_arguments as follows. The dash_initial_arguments is a string of serialized JSON that is generated via views.py and passed to the Django template via context.

{% plotly_app name="MyApp" ratio=1 initial_arguments=dash_initial_arguments %}

Prior to v1.6.1, this worked as intended. However, there was a change to dash_wrapper.py in v1.6.1 that removed the JSON deserialization logic. Specifically, this change occurred in cddf575.

Screen Shot 2021-03-15 at 2 02 17 PM

initial_arguments is still a string, but since the parsing has been removed, this now results in the following error:

ValueError: dictionary update sequence element #0 has length 1; 2 is required

@sdementen or @sebastiendementen do you have any context for why this parsing logic was removed?

@sdementen
Copy link
Contributor

@gabegrand not that I can recall! Sorry for the regression!

@gabegrand
Copy link
Author

@sdementen No worries! Let us know if you're able to work the fix into the next release. Thanks!

sdementen pushed a commit to sdementen/django-plotly-dash that referenced this issue Mar 16, 2021
- converting initial_arguments given as json string into a dict in `store_initial_arguments`
- add in the test of the template tag a call to the _dash-layout to ensure the initial_arguments are parsed properly
@sdementen
Copy link
Contributor

hi @gabegrand,
could you check the fix on your side/case ?

@gabegrand
Copy link
Author

I've confirmed that downgrading to v1.6.0 does fix the error!

@ghost
Copy link

ghost commented Mar 16, 2021 via email

@GibbsConsulting
Copy link
Owner

Looks like merging the PR automatically closed the issue. The fix is now released as 1.6.2 - please reopen this issue if it doesn't address it.

@gabegrand
Copy link
Author

@GibbsConsulting @sdementen thanks very much for the prompt fix!

@sdementen
Copy link
Contributor

sdementen commented Mar 18, 2021 via email

@gabegrand
Copy link
Author

Yes, the fix did work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants