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

List objects not being displayed properly in gr.json() objects #8373

Closed
1 task done
mberco-quandl opened this issue May 24, 2024 · 2 comments
Closed
1 task done

List objects not being displayed properly in gr.json() objects #8373

mberco-quandl opened this issue May 24, 2024 · 2 comments
Labels
bug Something isn't working Priority High priority issues

Comments

@mberco-quandl
Copy link

Describe the bug

When returning a python list to a gr.json() object it does not properly format it. See how it introduces a pseudo key-value appearing structure within the square bracers of the list. Peculiarly, when one clicks the "Copy" button on the gr.json() object, properly formatted json is copied as shown below! It appears to be solely a visual artefact.

[
  {
    "match_ordinal": "1",
    "match_score": "99",
    "org_name": "JP Morgan Securities plc (Frankfurt am Main Branch)",
    "org_perm_id": "5001223099",
    "uuid": "1"
  }
]

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
with gr.Blocks() as demo:
    text_output = gr.Text()
    json_output = gr.JSON()
    
    def return_list():
        my_list = [{"some": "data"}]
        return my_list, my_list
   
   demo.load(return_list, inputs=None, outputs=[text_output, json_output])

Screenshot

image

Logs

no errors.

System Info

gradio=4.27.0

Severity

I can work around it

@mberco-quandl mberco-quandl added the bug Something isn't working label May 24, 2024
@abidlabs
Copy link
Member

Yes agreed we should fix this, we’ve heard this reported before I believe

@abidlabs abidlabs added the Priority High priority issues label May 24, 2024
@abidlabs
Copy link
Member

Here's the duplicate: #6949 so let me close this one

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority High priority issues
Projects
None yet
Development

No branches or pull requests

2 participants