-
Notifications
You must be signed in to change notification settings - Fork 22
fs: local: Accept list of paths in rm.
#176
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
Conversation
cd8213a to
9fc0f5a
Compare
Codecov ReportBase: 71.78% // Head: 72.03% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
==========================================
+ Coverage 71.78% 72.03% +0.24%
==========================================
Files 25 25
Lines 1641 1659 +18
Branches 206 209 +3
==========================================
+ Hits 1178 1195 +17
+ Misses 433 432 -1
- Partials 30 32 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
To comply with fsspec.
9fc0f5a to
9b16b80
Compare
| self.fs.rm_file(path) | ||
|
|
||
| def rm(self, path: AnyFSPath) -> None: | ||
| self.fs.rm(path, recursive=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason to hardcode recursive=True here?
It doesn't comply with fsspec and was introducing even more overhead in the underlying expand_path call for each dvc-{x} filesystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure, given that we also define LocalFilesystem.rm(remove=False)
I think we should be exposing the flag properly here and defaulting to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that our old filesystem's (aka remote aka tree) rm method was always recursive. Might be not needed anymore, but that will require checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked dvc repo and the only place potentially affected I have found is in output (treeverse/dvc#8825)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daavoo Thank you for checking it!
|
@daavoo I think it's not just about fsspec compliance but also performance, right? This would go a long way towards fixing treeverse/dvc#5961, right (it would also fix treeverse/dvc#8757)? Can we see what these changes look like in dvc-bench? |
The actual P.R. fixing treeverse/dvc#5961 is treeverse/dvc-data#244 , this is a pre-requisite for that P.R. to don't break local gc.
Indeed this P.R. should fix treeverse/dvc#8757
As of today, no. I have opened treeverse/dvc-bench#407 |
By the way, I'd be curious to see the results of these changes for other benchmarks besides gc. |
Per changes in treeverse/dvc-objects#176
To comply with fsspec.
https://github.com/fsspec/filesystem_spec/blob/master/fsspec/implementations/local.py#L161
Also closes treeverse/dvc#8757