Kaggle / kagglehub

Python library to access Kaggle resources
Apache License 2.0
87 stars 17 forks source link

[b/307966230] Implement force_download option for model_download over HTTP #44

Closed lucyhe closed 10 months ago

lucyhe commented 10 months ago

Previously, after a model or file was downloaded with model_download, there was no way to programmatically force a new download. This PR enables forced downloads.

More Details

New flag usage:

kagglehub.model_download(model_handle, force_download=True)
kagglehub.model_download(model_handle, path=path, force_download=True)
lucyhe commented 10 months ago

I refactored some tests so that the new force_download tests wouldnt feel too verbose. Please let me know if you disagree with any refactoring, and I'm happy to revert!

rosbo commented 10 months ago

And also, looks like shutil.rmtree is failing for some versions of Python based on whether files are there or not. See the tests run from CI.

lucyhe commented 10 months ago

And also, looks like shutil.rmtree is failing for some versions of Python based on whether files are there or not. See the tests run from CI.

Thanks for the quick review! Are the CI checks identical except for python version? Want to make sure I've narrowed down what could be happening