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 bug where file examples can be corrupted if has multiple extensions #4440

Merged
merged 9 commits into from
Jun 7, 2023

Conversation

freddyaboulton
Copy link
Collaborator

@freddyaboulton freddyaboulton commented Jun 7, 2023

Description

Fixes #4424 by preserving the entire filename in the file cached for examples

Checklist:

  • I have performed a self-review of my own code
  • I have added a short summary of my change to the CHANGELOG.md
  • My code follows the style guidelines of this project
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in CHANGELOG.md, unless the pull request is labeled with the "no-changelog-update" label.

Please add a brief summary of the change to the Upcoming Release > Full Changelog 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)".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file using the
GitHub web UI since that lets you upload files directly via drag-and-drop.

@gradio-pr-bot
Copy link
Collaborator

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

@WilliamRoyNelson
Copy link
Contributor

The changelog for gradio-client is currently a little off. I have a PR to fix it, but I want to make sure that your changes to the changelog don't result in a merge conflict.

Before merging, would you please ensure that everything's in the right place?
#4441



@pytest.mark.asyncio
async def test_examples_keep_all_suffixes(tmp_path):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to release a new version of the client to get this test to pass

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

abidlabs commented Jun 7, 2023

LGTM @freddyaboulton thanks for this fix! Also fixes a long-standing problem with the name of cached example output files would be different than if you just re-ran the function.

I'll start by releasing a version of the Python Client (0.2.6) off of this branch. Then, will confirm tests for the main library are passing before merging in this PR

@abidlabs
Copy link
Member

abidlabs commented Jun 7, 2023

@WilliamRoyNelson I also moved the changelog entries to the right place, thanks for bringing that to our attention

@abidlabs
Copy link
Member

abidlabs commented Jun 7, 2023

Everything looks good, thanks folks!

@abidlabs abidlabs merged commit 4a58cce into main Jun 7, 2023
@abidlabs abidlabs deleted the 4424-fix-filename-examples-two-periods branch June 7, 2023 20:05
@freddyaboulton
Copy link
Collaborator Author

Thanks for the review @abidlabs !

@pngwn pngwn mentioned this pull request Jul 26, 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.

Examples bug when filename has two periods
4 participants