paiqo / Databricks-VSCode

VSCode extension to work with Databricks
GNU General Public License v3.0
123 stars 27 forks source link

Image cell renderer not working #162

Closed phuismann closed 1 year ago

phuismann commented 1 year ago

I'm was trying to plot in cell mode and databricks power tools using matplotlib and always get empty cells.

image

Even tho the example is with geopandas just simple matplotlib lineplots are not showing up too.

I tried using display(fig) aswell and am on Mac.

Ony idea what could be going wrong?

gbrueckl commented 1 year ago

do you have some full code as a repo so I could try to reproduce this on my side? just has to be a simple plot

phuismann commented 1 year ago

I can provide you with a very very basic example of what doesnt work here:

import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(20, 5))
x = [0, 10, 50, 100, 200]
y = [23, 21, 1,2 , 3]
ax.plot(x , y)

Sometimes I get the error: "TypeError: Cannot read properties of undefined (reading 'error')"

Some other informations that are maybe relevant:

JuanEcheagaray75 commented 1 year ago

I'm experiencing the same issue here, except my VS Code instance is running on an Azure Virtual Desktop machine

gbrueckl commented 1 year ago

I just tried the sample code and it worked as epxected: image

it might be related to MacOS though as the image is returned as PNG which does not work well with MacOS ?! (I am not a MacOS user :D )

gbrueckl commented 1 year ago

closing as no further feedback was provided and issue is not reproduceable

tsveiga commented 11 months ago

Hi! Reusing this issue to avoid opening a new one on the same topic.

I am experiencing the same behavior as described by the above users, although without any errors. Taking the basic example given before, the cell outputs only the handle of the plot.

bilde

After digging a bit, it seems that the raw file does not include the image data. This is the raw data for this cell, under "data" there should be an image field.

bilde

Furthermore, if I run the cell directly in Databricks through the browser UI and download it afterwards, then the downloaded notebook includes the image data and it gets properly displayed. Also, if I run the notebook locally then it is fine as well.

I am VSCode v1.84.2 on Windows 10 with the latest extension version, but have tried on a setup with Linux Mint with the same behavior. Thankful if we can get some pointers on this!