-
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
dvcfs: detach from pipeline outputs #7353
Conversation
Introducing simple repo tree that combines all workspaces into one structure, and allows us to detach data representation from pipelines. Pre-requisite for dvc-data extraction and using relpaths in dvcfs/repofs.
shortest = self.repo.index.tree.shortest_prefix(key) | ||
if shortest: | ||
assert shortest[1][1].isdir | ||
if len(shortest[0]) <= len(key): | ||
ret["isdvc"] = 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.
These odd flags and logic will be removed in a followup, when we just use fs and dvcfs separately (with subrepos), instead of passing through tons of odd flags used inappropriately in ls and diff.
@@ -168,7 +168,7 @@ def _build_tree(fs_path, fs, name, **kwargs): | |||
assert key | |||
tree.add(key, meta, obj.hash_info) | |||
|
|||
tree_meta.size += meta.size | |||
tree_meta.size += meta.size or 0 |
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.
Excuse me, why can not just set them default 0? Like in C
or Java
current None
is just like null
point in other languages.
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.
@karajan1001 This is a bit messy, but we have meta set to None for files inside of dvc add dir
dirs. There seems to be a value in separating 0 and "not set" state, but you are right, we'll probably set it to defaults in the future.
if not odb: | ||
continue | ||
|
||
try: |
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.
Can reduce one line.
with suppress(FileNotFoundError, ObjectFormatError):
Introducing simple repo tree that combines all workspaces into one structure,
and allows us to detach data representation from pipelines.
Pre-requisite for dvc-data extraction and using relpaths in dvcfs/repofs.