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

change event doesn't be detected when value is component in gr.Dataframe #10601

Open
1 task done
Yb2S3Man opened this issue Feb 17, 2025 · 0 comments
Open
1 task done
Labels
bug Something isn't working 💾 Dataframe

Comments

@Yb2S3Man
Copy link

Describe the bug

I have a seven columns' dataframe, and the final column is html style selection component.
When I select the value in such column, change event cannot be detected.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
def __correct__(row):
    return """<select>
                    <option value='0' selected>Unknown</option>
                    <option value='1'>NASR</option>
                    <option value='2'>Microsoft</option>
                    <option value='3'>Reference</option>
                </select>"""

def load_file(src_full_path_name):
    df = pd.read_csv(src_full_path_name) 
    df['Correct'] = df['Correct'].apply(__correct__)
    return gr.Dataframe(value=df, type="pandas", datatype='html', 
                        max_height=750, interactive=True, show_label=False,
                        render=True, visible=True, label='table')

def capture_edited_data(dataframe):
    if len(dataframe) == 0:
        return gr.update()
    # This is not be called, when I select different values

with gr.Blocks() as demo:
    source_file = gr.Dropdown(label="Choose one File", multiselect=False, elem_id='source_file')
    load_btn = gr.Button("Load", elem_id="load_btn", interactive=True)
    table_output = gr.Dataframe(row_count=1, col_count=7, label="table", show_label=False)
table_output.change(fn=capture_edited_data, inputs=table_output, outputs=[])
load_btn.click(fn=load_file, inputs=[source_file],  outputs=[table_output])


if __name__ == '__main__':
    demo.launch(server_name='localhost',
                server_port=54321,
                share=False, debug=True)

Screenshot

No response

Logs

System Info

aiofiles==23.2.1
annotated-types==0.7.0
anyio==4.8.0
certifi==2024.12.14
charset-normalizer==3.4.1
click==8.1.8
dohq-artifactory==1.0.0
exceptiongroup==1.2.2
fastapi==0.115.6
ffmpy==0.5.0
filelock==3.17.0
fsspec==2024.12.0
gradio==5.12.0
gradio_client==1.5.4
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
huggingface-hub==0.27.1
idna==3.10
Jinja2==3.1.5
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
numpy==2.2.2
orjson==3.10.15
packaging==24.2
pandas==2.2.3
pillow==11.1.0
pip==24.3.1
pydantic==2.10.5
pydantic_core==2.27.2
pydub==0.25.1
Pygments==2.19.1
PyJWT==2.10.1
python-dateutil==2.9.0.post0
python-multipart==0.0.20
pytz==2024.2
PyYAML==6.0.2
requests==2.32.3
rich==13.9.4
ruff==0.9.2
safehttpx==0.1.6
semantic-version==2.10.0
setuptools==73.0.1
shellingham==1.5.4
six==1.17.0
sniffio==1.3.1
starlette==0.41.3
tomlkit==0.13.2
tqdm==4.67.1
typer==0.15.1
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
uvicorn==0.34.0
websockets==14.2
wheel==0.44.0

Severity

Blocking usage of gradio

@Yb2S3Man Yb2S3Man added the bug Something isn't working label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 💾 Dataframe
Projects
None yet
Development

No branches or pull requests

2 participants