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

Check for assets with size of 0 bytes #10026

Merged
merged 2 commits into from
Jan 12, 2022
Merged

Check for assets with size of 0 bytes #10026

merged 2 commits into from
Jan 12, 2022

Conversation

ryndaniels
Copy link
Contributor

Description

I ran into an issue where, if downloading an asset (without a checksum) failed in a way that left a 0-byte file on disk, the next run of spacy project assets would assume the asset doesn't need to be redownloaded. 0-byte files are probably never what we want, so if that's the case, let's delete it so it will reattempt the download (and warn the user):

Screen Shot 2022-01-11 at 15 42 13

Types of change

Bug fix

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@honnibal
Copy link
Member

Ah I've wanted this check! Great idea thanks.

@svlandeg svlandeg added enhancement Feature requests and improvements feat / cli Feature: Command-line interface labels Jan 11, 2022
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

Great idea, thanks Ryn!

spacy/cli/project/assets.py Outdated Show resolved Hide resolved
Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
@svlandeg svlandeg merged commit 057b8c6 into master Jan 12, 2022
@svlandeg svlandeg deleted the rfd-0-byte-files branch January 12, 2022 09:34
polm pushed a commit to polm/spaCy that referenced this pull request Jan 17, 2022
* Check for assets with size of 0 bytes

* Update spacy/cli/project/assets.py

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and improvements feat / cli Feature: Command-line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants