Skip to content
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

Introduce skip_invalid argument to figure #1162

Merged
merged 4 commits into from
Sep 8, 2018
Merged

Introduce skip_invalid argument to figure #1162

merged 4 commits into from
Sep 8, 2018

Conversation

jonmmease
Copy link
Contributor

This PR introduces a new public skip_invalid kwarg to Figure and FigureWidget.

When set to False (the default) invalid properties in the specification of data, layout, or frames will raise a ValueError. This is the current behavior.

When set to True, invalid properties in the figure specification (invalid by property name or by property value) will be silently skipped, and no ValueError will be raised.

This new property serves a similar function to the pre-v3 internal _raise kwarg. But it's been renamed and made public as I expect it to be a useful option to expose to users, especially in the context of loading a figure specification from an outside source.

See discussion in #1158
cc: @scjody

When set to True (Default is False) all invalid properties (invalid
by name or by value) will be skipped an no exception will be raised
due to schema violations.  The option applies recursively to all
child objects, but it only applies within the scope of the constructor.

Still TODO: add the skip_invalid option to the figure constructor.
propagate this state to trace, layout, and frames validators during
figure construction.
Added docstring documentatin of skip_invalid, and added
new tests.

When set to True (Default is False) all invalid properties (invalid
by name or by value) will be skipped an no exception will be raised
due to schema violations.  The option applies recursively to all
child objects, but it only applies within the scope of the constructor.
This restores the pre v3 behavior of silently ignoring invalid
properties when retrieving a figure from plot.ly
…re`"

This will take a bit more thought. We'll get back to this during the
develop,ent of plotly.io.

This reverts commit 744d947.
@jonmmease jonmmease merged commit 7ddd1c9 into master Sep 8, 2018
@jonmmease jonmmease added this to the v3.2.1 milestone Sep 8, 2018
@nicolaskruchten nicolaskruchten deleted the bug_1158 branch June 19, 2020 16:10
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

Successfully merging this pull request may close these issues.

1 participant