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

Honor cache storage when file get pulled into cache #513

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

AlexVCaron
Copy link
Contributor

This PR adds a simple fix for #512, so the cache storage configuration is honoured when pulling remote files into cache.

Copy link

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

Thanks for the clear issue and PR!

@skshetry Could you also take a look? Is there anywhere we could add a test?

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 63.08%. Comparing base (b156af0) to head (d601547).

Files Patch % Lines
src/dvc_data/fs.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #513      +/-   ##
==========================================
- Coverage   63.09%   63.08%   -0.02%     
==========================================
  Files          62       62              
  Lines        4341     4342       +1     
  Branches      735      735              
==========================================
  Hits         2739     2739              
- Misses       1445     1446       +1     
  Partials      157      157              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skshetry
Copy link
Member

skshetry commented Mar 7, 2024

Thanks for the PR, @AlexVCaron.

Note that this will only work if the file is being checked out from the cache. If the file is checked out in the workspace, it'll be copied to a new destination.

assert os.path.exists("foo")
fs = DVCFileSystem()
fs.get_file("foo", "bar")

Also note that this feature is mostly for internal use, as get_file() is not supposed to symlink a file in fsspec.

@skshetry
Copy link
Member

skshetry commented Mar 7, 2024

@skshetry Could you also take a look? Is there anywhere we could add a test?

Ideally, this would be tested on dvc side.

@skshetry skshetry merged commit 7485f9a into iterative:main Mar 7, 2024
17 checks passed
@AlexVCaron AlexVCaron mentioned this pull request Mar 7, 2024
10 tasks
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.

4 participants