Skip to content
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

Data Grid renderer does not show list output #149

Closed
jmagosta opened this issue Feb 28, 2023 · 12 comments
Closed

Data Grid renderer does not show list output #149

jmagosta opened this issue Feb 28, 2023 · 12 comments
Labels
invalid This doesn't seem right wontfix This will not be worked on

Comments

@jmagosta
Copy link

If one has switched to the grid renderer any list output is not displayed.

For instance:
image

This happened unexpectedly -- I don't recall loading this extension, or setting the display output to data grid. In any case returning no output for lists should not be a valid behavior.

@RandomFractals
Copy link
Owner

RandomFractals commented Feb 28, 2023

@jmagosta could you please share your notebook?

What type of notebook are you using and what is that list cell code?

VSCode does use built-in renderers by default, and I documented the supported notebook cell output formats in extension docs already.

I don't think your cell output is csv, json or any of the other supported data formats.

See Features in docs for more info: https://github.com/RandomFractals/vscode-data-table#-features

@RandomFractals RandomFractals added invalid This doesn't seem right wontfix This will not be worked on labels Feb 28, 2023
@jmagosta
Copy link
Author

jmagosta commented Feb 28, 2023 via email

@amunger
Copy link

amunger commented Mar 1, 2023

the output is an array:

"data": {
    "text/plain": [
        "[0, 1, 2, 3, 4]"
    ]
},

@jmagosta
Copy link
Author

jmagosta commented Mar 1, 2023 via email

@amunger
Copy link

amunger commented Mar 1, 2023

I was responding to @RandomFractals comment

I don't think your cell output is csv, json or any of the other supported data formats.

Also, on this -

VSCode does use built-in renderers by default

Merely installing this extension causes this blank output to show up, so the extension's renderer is prioritized over the built-in

@gbrueckl
Copy link

gbrueckl commented Mar 1, 2023

so the output of that command list(range(5)) is a text/plain as already mentioned by @amunger
the data table renderers are mainly for displaying data frames/tables and not for text outputs like in your example.
it will be displayed the same way as any other text e.g. "My random text"
Thats what Databricks returns, a text and not a table hence your text will not be rendered properly as a list or table
if you were to use display(df) instead, it would output as text/x-json and json/application which will then be rendered properly using the Table Renderers

@jmagosta
Copy link
Author

jmagosta commented Mar 1, 2023 via email

@RandomFractals
Copy link
Owner

RandomFractals commented Mar 1, 2023

@gbrueckl thanks for clarifying the way data table renderers work.

@jmagosta you should use built-in or other renderers for your list.

This extension is open source and you can actually see where and how cell output is handled and parsed in getData() in our outputLoader.ts: https://github.com/RandomFractals/vscode-data-table/blob/main/src/renderer/outputLoader.ts#L22

It would help if you actually included a simple notebook to reproduce your issue better. Your output screenshot doesn't even show the whole cell output rendering or anything about that list.

@jmagosta
Copy link
Author

jmagosta commented Mar 1, 2023

A list, unlike a text string or tuple results in no display at all. Merely installing this extension causes this blank output to show up, because the extension's renderer is prioritized over the built-in. This is inconsistent, confusing behavior.

@RandomFractals

This comment was marked as off-topic.

@amunger
Copy link

amunger commented Mar 1, 2023

the repro notebook is a single code cell. Running the cell with this extension installed will result in a blank output.

list(range(5))

repro.zip

@gbrueckl
Copy link

gbrueckl commented Mar 2, 2023

so it works (in terms of displaying some text) for me:
using built-in VSCode renderer:
image

using Data Table renderer from this extension:
image

using Data Summary renderer from this extension
image

using Flat Data Grid renderer from this extension:
image

as I said, it is just a text thats returned by databricks and the extension tries to parse it into table as it is built for tabular visulalization. I agree that the output is useless but thats because of the input and not because of the renderer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants