apple / turicreate

Turi Create simplifies the development of custom machine learning models.
BSD 3-Clause "New" or "Revised" License
11.19k stars 1.14k forks source link

SFrame.show in Jupyter Notebook raises exception #518

Closed znation closed 6 years ago

znation commented 6 years ago

Repro steps (in Jupyter Notebook):

import turicreate as tc
sf = tc.SFrame.read_csv('/Users/zach/data/manyappend_clang_format.csv')
sf.show()

Expected: No errors, plot displays inline the notebook Actual: Plot opens in a separate window (I'm guessing due to use of exceptions for control flow), and this error is shown in the notebook:

Materializing SFrame...
Done.
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-9d778c121b4c> in <module>()
----> 1 sf.show()

/Users/zach/turicreate/debug/src/unity/python/turicreate/data_structures/sframe.pyc in show(self)
   4455         returned_plot = self.plot()
   4456 
-> 4457         returned_plot.show()
   4458 
   4459     def plot(self):

/Users/zach/turicreate/debug/src/unity/python/turicreate/visualization/_plot.pyc in show(self)
    101             if _target == 'auto' and \
    102                get_ipython().__class__.__name__ == "ZMQInteractiveShell":
--> 103                 self._repr_javascript_()
    104                 display = True
    105         except NameError:

/Users/zach/turicreate/debug/src/unity/python/turicreate/visualization/_plot.pyc in _repr_javascript_(self)
    201         from IPython.core.display import display, HTML
    202 
--> 203         vega_spec = self._get_vega(True)["vega_spec"]
    204 
    205         vega_html = '<html lang="en"> \

KeyError: 'vega_spec'
znation commented 6 years ago

Also seems to repro for SArray.show: sf['Lines Added'].show().

znation commented 6 years ago

And tc.show as well: tc.show(sf['Lines Added'], sf['Lines Removed']).