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
various display type validations #4565
Conversation
"""Validate that display data is text""" | ||
def _check_data(self): | ||
if self.data is not None and not isinstance(self.data, string_types): | ||
raise TypeError("%s xpects text, not %r" % (self.__class__.__name__, self.data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xpects
.
The test faillure is in part due to an error on isolated SVG. might be related. |
Still a typo, and relaunched the test to see if the failure is reproducible. |
What the status of this one ? |
looking into the test failure now - in interactive use, the code in the test passes just fine, so something weird is going on. |
it comes out - this.test.assertEquals(colors[0], '#ff0000', 'First svg should be red');
- this.test.assertEquals(colors[1], '#000000', 'Second svg should be black');
+ this.test.assertEquals(colors && colors[0], '#ff0000', 'display_svg() First svg should be red');
+ this.test.assertEquals(colors && colors[1], '#000000', 'display_svg() Second svg should be black'); |
Nice - I think I'm on the trail of an actual undesired change in behavior. Just need to figure out the cause... |
Should be passing now. |
+1 I suppose at some point we could check_return using annotation on PY3, but that's for latter. |
@@ -282,9 +303,22 @@ def __call__(self, obj): | |||
return printer(obj) | |||
return None | |||
except Exception: | |||
pass | |||
self._handle_format_error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a duplicate of the warning display you added in #4745 - is it now unnecessary?
this no longer merges cleanly, either :\ |
I haven't touched this one in a while because I will need to rebase it after #4533 is merged |
and show error messages when formatters fail
at DisplayObject construction time
everything is a string, if anything else is sent, drop it so it doesn't show up in the notebook document.
validates from files, as well as from kernels
rebased |
various display type validations to protect notebooks from invalid display data, and add informative errors for invalid data.
various display type validations to protect notebooks from invalid display data, and add informative errors for invalid data.
Each of these individually would fix #4564