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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wrong Deprecation Warning message for type/plot parameter #4709

Merged
merged 5 commits into from Jun 28, 2023

Conversation

freddyaboulton
Copy link
Collaborator

@freddyaboulton freddyaboulton commented Jun 28, 2023

Description

While testing #4705 , I noticed that the Video component will emit a deprecation warning telling the user to use the Number component instead which makes no sense:

image

going back to https://github.com/gradio-app/gradio/pull/1090/files, this warning should only be emitted if type is used for the Textbox component. However, the Textbox component already checks if a faulty type arg is passed in so I think we can just get rid of that warning string.

Similarly the plot parameter originally applied to Image so we should only emit it for the image component.

Added a GradioUnusedKwargWarning class as well since an unused kwarg is not a deprecation warning

馃幆 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests & Changelog

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

  3. Unless the pull request is labeled with the "no-changelog-update" label by a maintainer of the repo, all pull requests must update the changelog located in CHANGELOG.md:

Please add a brief summary of the change to the Upcoming Release section of the CHANGELOG.md file and include
a link to the PR (formatted in markdown) and a link to your github profile (if you like). For example, "* Added a cool new feature by [@myusername](link-to-your-github-profile) in [PR 11111](https://github.com/gradio-app/gradio/pull/11111)".

@gradio-pr-bot
Copy link
Contributor

All the demos for this PR have been deployed at https://huggingface.co/spaces/gradio-pr-deploys/pr-4709-all-demos

@freddyaboulton freddyaboulton marked this pull request as ready for review June 28, 2023 16:15
Copy link
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

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

Can confirm i am no longer seeing this warning (which was very confusing, i agree)! Thanks @freddyaboulton!

@freddyaboulton
Copy link
Collaborator Author

Thank you @pngwn ! Will merge once CI passes!

@freddyaboulton freddyaboulton merged commit 2baf33c into main Jun 28, 2023
11 checks passed
@freddyaboulton freddyaboulton deleted the fix-wrong-deprecation-message branch June 28, 2023 19:02
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.

None yet

3 participants