-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Deep magic underscore error messages rebase #2843
Deep magic underscore error messages rebase #2843
Commits on Oct 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2209b2d - Browse repository at this point
Copy the full SHA 2209b2dView commit details
Commits on Oct 20, 2020
-
Configuration menu - View commit details
-
Copy full SHA for afd5b7a - Browse repository at this point
Copy the full SHA afd5b7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b894b89 - Browse repository at this point
Copy the full SHA b894b89View commit details -
Also state when a property doesn't support subscripting
Shows the property that doesn't support it. Need to still update the tests though.
Configuration menu - View commit details
-
Copy full SHA for 4c659db - Browse repository at this point
Copy the full SHA 4c659dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2bf2526 - Browse repository at this point
Copy the full SHA 2bf2526View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5695969 - Browse repository at this point
Copy the full SHA 5695969View commit details
Commits on Oct 23, 2020
-
Improved error message when subscripting types that don't support it
For example, `fig.update_layout(width_x=1)` gives the following error message: TypeError: 'NoneType' object is not subscriptable Invalid value received for the 'width' property of layout The 'width' property is a number and may be specified as: - An int or float in the interval [10, inf] Property does not support subscripting: width_x ~~~~~ because `fig.layout['width']` can't be subscripted (you can't do `fig.layout['width']['x'] = 1`)
Configuration menu - View commit details
-
Copy full SHA for 22b3e03 - Browse repository at this point
Copy the full SHA 22b3e03View commit details -
Configuration menu - View commit details
-
Copy full SHA for c09c03e - Browse repository at this point
Copy the full SHA c09c03eView commit details
Commits on Nov 4, 2020
-
Changed PlotlyKeyError's superclass to KeyError
But overrode the __str__ method.
Configuration menu - View commit details
-
Copy full SHA for f4be2b1 - Browse repository at this point
Copy the full SHA f4be2b1View commit details -
BasePlotlyType._raise_on_invalid_property_error raises PlotlyKeyError
It used to raise ValueError but PlotlyKeyError subclasses KeyError and is the more relevant exception. PlotlyKeyError maintains the nice printing of the errors, unlike KeyError.
Configuration menu - View commit details
-
Copy full SHA for 73051a6 - Browse repository at this point
Copy the full SHA 73051a6View commit details -
Cast some errors to PlotlyKeyError
Because lookup in subclasses of BasePlotlyType and BaseFigure should throw KeyError.
Configuration menu - View commit details
-
Copy full SHA for 651b712 - Browse repository at this point
Copy the full SHA 651b712View commit details -
Updated the tests to reflect the new Exception behaviour
I believe the new behaviour is consistent with the previous exception behaviour, but we will run the CI tests to be sure.
Configuration menu - View commit details
-
Copy full SHA for 9bb2470 - Browse repository at this point
Copy the full SHA 9bb2470View commit details
Commits on Nov 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for bf4cd97 - Browse repository at this point
Copy the full SHA bf4cd97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d42ffe - Browse repository at this point
Copy the full SHA 7d42ffeView commit details -
Configuration menu - View commit details
-
Copy full SHA for a18b341 - Browse repository at this point
Copy the full SHA a18b341View commit details -
Now subscripting errors triggered on types throwing TypeError
Before the subscripting error was only thrown for NoneType objects, but because stuff like `"hello"["hi"]` and `1["hey"]` also are invalid, and these also throw TypeError, then these throw the subscripting error message too. HOWEVER, this error is casted to ValueError on property assignment and PlotlyKeyError on property read, to keep consistency among the exception types.
Configuration menu - View commit details
-
Copy full SHA for 4bda7b2 - Browse repository at this point
Copy the full SHA 4bda7b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e1b667 - Browse repository at this point
Copy the full SHA 9e1b667View commit details
Commits on Nov 9, 2020
-
Changed dict path error display to always ^
and underneath the whole offending part of the path e.g., the_badpart_of_the_path ^^^^^^^ for both property and subscripting errors.
Configuration menu - View commit details
-
Copy full SHA for d6aee64 - Browse repository at this point
Copy the full SHA d6aee64View commit details -
Try taking length of string-like objects
then if that fails, try and print the int, then if that fails, truely fail. This allows taking the length of unicode objects in Python2.
Configuration menu - View commit details
-
Copy full SHA for c6e5b4d - Browse repository at this point
Copy the full SHA c6e5b4dView commit details -
leading, trailing, multiple underscores detected in dict path strings
need to add tests
Configuration menu - View commit details
-
Copy full SHA for 82f9bb1 - Browse repository at this point
Copy the full SHA 82f9bb1View commit details
Commits on Nov 10, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 70f18ca - Browse repository at this point
Copy the full SHA 70f18caView commit details -
Complain about trailing underscores, find closest key
Tests in tests/test_core/test_errors/test_dict_path_errors.py not yet updated though.
Configuration menu - View commit details
-
Copy full SHA for 00851fa - Browse repository at this point
Copy the full SHA 00851faView commit details -
Configuration menu - View commit details
-
Copy full SHA for d2bc400 - Browse repository at this point
Copy the full SHA d2bc400View commit details -
Key guessing before and after list of valid properties
Also tripped when no underscore paths are used, e.g., fig.data[0].line["colr"] = "blue"
Configuration menu - View commit details
-
Copy full SHA for 20518c1 - Browse repository at this point
Copy the full SHA 20518c1View commit details
Commits on Nov 11, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 4066ae2 - Browse repository at this point
Copy the full SHA 4066ae2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86f4217 - Browse repository at this point
Copy the full SHA 86f4217View commit details