-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 event triggers and recent regressions related to gr.DataFrame
#10403
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/215b9e933f9804ac80da3631da16d1c221172271/gradio-5.12.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@215b9e933f9804ac80da3631da16d1c221172271#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/215b9e933f9804ac80da3631da16d1c221172271/gradio-client-1.10.0.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/215b9e933f9804ac80da3631da16d1c221172271/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
js/dataframe/shared/Table.svelte
Outdated
let old_val: undefined | (string | number)[][] = undefined; | ||
let previous_data_string = "[]"; | ||
let previous_headers_string = "[]"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why arent these
let previous_data_string = JSON.stringify(
data.map((row) => row.map((cell) => String(cell.value)));
let previous_headers_string = JSON.stringify(...)
Won't this cause a change dispatch immediately because of the
if (
current_data_string !== previous_data_string ||
current_headers_string !== previous_headers_string
)
later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't dispatch immediately, but I'm not sure why. I can make the change though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initial dispatches often don't, but I think it's flaky. Better to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, lgtm!
Thanks @aliabid94! Fixed the issue above, will merge in once CI passes |
Fixes a few things that were broken or broke as a result of recent PRs
.input()
and.change()
events in gr.Dataframe are also triggered at function updates and at app start #8231 and adds a test)Some other minor refactoring of
Table.svelte
(more to come in a separate PR)