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

Fix data model for gr.DataFrame #6310

Merged
merged 10 commits into from
Nov 7, 2023
Merged

Fix data model for gr.DataFrame #6310

merged 10 commits into from
Nov 7, 2023

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Nov 6, 2023

Closes: #6297

Test with:

import gradio as gr
import pandas as pd


def fn(df: pd.DataFrame) -> str:
    return df


df_orig = pd.DataFrame(data={"a": [1, 2, 3]})

with gr.Blocks() as demo:
    df = gr.Dataframe(value=df_orig, type="pandas")
    df2 = gr.Dataframe(value=df_orig, type="pandas")
    btn = gr.Button()

    btn.click(fn=fn, inputs=df, outputs=df2)

demo.launch()

or repro in original issue

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Nov 6, 2023

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook failed! Details
Visual tests all good! Build review
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/35de9e0fa588c57d459b55eae4fc00f5eed929f1/gradio-4.1.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@35de9e0fa588c57d459b55eae4fc00f5eed929f1#subdirectory=client/python"

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Nov 6, 2023

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Fix data model for gr.DataFrame

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

Copy link
Collaborator

@hysts hysts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM!

@abidlabs abidlabs merged commit dfdaf10 into main Nov 7, 2023
@abidlabs abidlabs deleted the fix-df-preprocessing branch November 7, 2023 03:04
@pngwn pngwn mentioned this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pydantic error occurs when passing gr.Dataframe
4 participants