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 event triggers and recent regressions related to gr.DataFrame #10403

Merged
merged 11 commits into from
Jan 22, 2025
Merged

Conversation

abidlabs
Copy link
Member

@abidlabs abidlabs commented Jan 22, 2025

Fixes a few things that were broken or broke as a result of recent PRs

Some other minor refactoring of Table.svelte (more to come in a separate PR)

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 22, 2025

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website building...
Storybook ready! Storybook preview
🦄 Changes detected! Details

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>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jan 22, 2025

🦄 change detected

This Pull Request includes changes to the following packages.

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

With the following changelog entry.

Fix event triggers and recent regressions related to 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.

@abidlabs abidlabs marked this pull request as ready for review January 22, 2025 01:51
let old_val: undefined | (string | number)[][] = undefined;
let previous_data_string = "[]";
let previous_headers_string = "[]";
Copy link
Collaborator

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

Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

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

Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

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

tested, lgtm!

@abidlabs
Copy link
Member Author

Thanks @aliabid94! Fixed the issue above, will merge in once CI passes

@abidlabs abidlabs merged commit 3219382 into main Jan 22, 2025
24 checks passed
@abidlabs abidlabs deleted the df-fix branch January 22, 2025 21:06
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.

The .input() and .change() events in gr.Dataframe are also triggered at function updates and at app start
3 participants