-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
repo: add helper method for doing data index lookup in subrepos #9708
Conversation
60cf0aa
to
eba72b9
Compare
Repo.open(url, path=...)
After looking at this some more, we don't actually want to open subrepo directly in dvc.api use cases, the caller will always be starting with the path relative to the git/scm root URL, and not relative to the subrepo nested root. What we really want is just a helper method that takes the original path (either relative to git/scm root URL or just a standard localfs path) and then returns the correct data index + entry for that path (taking into account subrepos when necessary). |
# pylint: disable-next=protected-access | ||
key = fs._get_key_from_relative(fs_path) | ||
# pylint: disable-next=protected-access | ||
subrepo, _, key = fs._get_subrepo_info(key) |
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.
This subrepo lookup still feels like it belongs in Repo
somewhere and not dvcfs, but at least this way the internal lookups are kept within the Repo
level helper method and we don't need to touch the dvcfs internals in dvc.api
methods
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #9708 +/- ##
==========================================
- Coverage 90.44% 90.18% -0.27%
==========================================
Files 480 480
Lines 36481 36468 -13
Branches 5249 5243 -6
==========================================
- Hits 32996 32888 -108
- Misses 2892 2962 +70
- Partials 593 618 +25
β View full report in Codecov by Sentry. |
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. π
Closes #9698