cloudpathlib
cloudpathlib copied to clipboard
Add exists check in download_to
Add .exists check before download_to and raise new CloudPathNotExistsError if the path does not exist.
Closes #430
🚀 Deployed on https://deploy-preview-433--gallant-agnesi-5f7bb3.netlify.app
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 93.5%. Comparing base (
71331d3) to head (c3ac4ec).
Additional details and impacted files
@@ Coverage Diff @@
## master #433 +/- ##
======================================
Coverage 93.5% 93.5%
======================================
Files 23 23
Lines 1650 1654 +4
======================================
+ Hits 1544 1548 +4
Misses 106 106
| Files | Coverage Δ | |
|---|---|---|
| cloudpathlib/cloudpath.py | 93.5% <100.0%> (+<0.1%) |
:arrow_up: |
| cloudpathlib/exceptions.py | 100.0% <100.0%> (ø) |
This adds an extra network call, right? (And we're already doing multiple network calls even before this change.) I don't love this, but I'm willing to be convinced this is okay for now and we track an issue to do this more intelligently.
This adds an extra network call, right? (And we're already doing multiple network calls even before this change.) I don't love this, but I'm willing to be convinced this is okay for now and we track an issue to do this more intelligently.
Yeah, it does. Where I landed was that I'd rather implement that through caching that kind of metadata intelligently at the client level so that the implementation here stays the same and network overhead is reduced.
Also, it is one call in each download_to, so that if you are doing a directory it doesn't happen for every file.