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

deps: bump dvc-objects, dvc-data and scmrepo #10280

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

Comment on lines +372 to +374
dvc_info = dvc_fs.info(dvc_path)
if dvc_info["type"] == "file":
dvc_infos[""] = dvc_info
Copy link
Member Author

Choose a reason for hiding this comment

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

Since fs.ls() is now expected to return result even if it's a file, we are keeping it in a special "" (root) key so that we can return result for the file easily.

Later, we check if the type of the path matches in both fs.info() and dvc_fs.info().
If they mismatch (eg: when a path data is tracked as a file in dvc, but is now a directory in the workspace or vice versa), we invalidate dvc_fs.info() and then return fs.info().
This is the behaviour that we have in the tests.

Comment on lines +86 to +88
if fs.isfile(fs_path):
infos[os.path.basename(path)] = fs.info(fs_path)
else:
Copy link
Member Author

Choose a reason for hiding this comment

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

I have switched the if-else here, since fs.walk() also returns result for files now.

@@ -459,7 +468,7 @@ def _info( # noqa: C901, PLR0912
continue

if not dvc_info and not fs_info:
raise FileNotFoundError
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), path)
Copy link
Member Author

Choose a reason for hiding this comment

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

Trying to improve error message as we now log the message for dvc ls.

I had to do that because you'd see an unexpected error in case of FileNotFoundErrror.

@shcheklein shcheklein mentioned this pull request Feb 5, 2024
2 tasks
@skshetry skshetry marked this pull request as ready for review February 6, 2024 01:16
@skshetry skshetry requested a review from a team February 6, 2024 01:17
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (2bf7bd9) 90.43% compared to head (27a0649) 90.42%.
Report is 1 commits behind head on main.

Files Patch % Lines
dvc/commands/ls/__init__.py 0.00% 2 Missing and 1 partial ⚠️
dvc/fs/callbacks.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10280      +/-   ##
==========================================
- Coverage   90.43%   90.42%   -0.01%     
==========================================
  Files         494      494              
  Lines       37782    37775       -7     
  Branches     5463     5467       +4     
==========================================
- Hits        34167    34157      -10     
- Misses       2984     2985       +1     
- Partials      631      633       +2     

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

@efiop efiop merged commit d25cb79 into iterative:main Feb 6, 2024
20 of 21 checks passed
@skshetry skshetry deleted the dvc-objects-v4 branch February 6, 2024 08:50
BradyJ27 pushed a commit to BradyJ27/dvc that referenced this pull request Apr 22, 2024
* deps: bump dvc-objects, dvc-data and scmrepo

* bump dvc-azure

* fix typo
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.

2 participants