Conversation
Contributor
|
All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-2804-all-demos |
freddyaboulton
approved these changes
Dec 13, 2022
Collaborator
freddyaboulton
left a comment
There was a problem hiding this comment.
Looks good @abidlabs ! Thanks for the fix. This fixes #2658 no? I would add pd.DataFrame to the value typehint for dataframe since that's missing right now.
I wonder if we can simplify the datatype argument for 4.0. It supports "datetime" which you'd think would take care of dates but it doesn't do anything except do markdown conversion if the datatype arg is markdown. Just a random thought while reviewing.
Member
Author
|
Thanks for the review @freddyaboulton! I had missed that issue, so will add that in. I'll change the base branch to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As I was writing the BigQuery guide, I noticed that we would run into an error if we passed in a
pd.DataFramethat contained numpy arrays or any non-builtin python types as thevalueof agr.DataFrame. In other words, this would error out:Interestingly, it would not error out if we returned such as pandas array from a function. The reason is that we were using different ways to serialize data before sending it to the frontend depending on if it was part of the config or not. This fixes that by using the same way (
orjson.dumps) to serialize both. It should make thepd.Dataframea lot more robust to different types. Also added a test and fixed some other tests which were incorrectly marked as async.Closes: #2658