sparkmagic icon indicating copy to clipboard operation
sparkmagic copied to clipboard

sparkmagic output html table

Open Tagar opened this issue 6 years ago • 1 comments

image

Is there is a way to actually display an html output, like it works without %%spark ?

Tagar avatar Feb 07 '19 01:02 Tagar

@itamarst please have a look if there is a way to fix this ?

thanks!

Tagar avatar Nov 15 '19 04:11 Tagar

Same in pyspark kernel, HTML outputs are not displayed but the HTML codes printed. Also the pandas DataFrames (note: not the pyspark DataFrame) are not being rendered prettified, even using display() or display_html().

Whereas running regular kernel (even in the same instance/python env) will render correctly.

Screenshot 2023-03-28 at 5 33 54 PM Screenshot 2023-03-28 at 5 33 38 PM

winston-zillow avatar Mar 29 '23 00:03 winston-zillow

@devstein please take a look. This seems an annoying problem.

winston-zillow avatar Mar 29 '23 16:03 winston-zillow

@winston-zillow Thanks for the example. As demonstrated in first example. Sparkmagic naively renders the response from Livy, which is the { 'text/html': '<h1>H1</h1>' } JSON. This should be fixable. Are you open to contributing?

The second example is much tricky. Your local notebook has access to the raw pandas dataframe while Sparkmagic has to parse the dataframe values from the JSON string returned from Livy. This is what the %%pretty magic attempts to do.

devstein avatar Apr 04 '23 23:04 devstein