-
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
dvc: separate cache and tree hashes #4511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from dataclasses import dataclass | ||
from dataclasses import dataclass, field | ||
|
||
HASH_DIR_SUFFIX = ".dir" | ||
|
||
|
@@ -7,6 +7,7 @@ | |
class HashInfo: | ||
name: str | ||
value: str | ||
dir_info: list = field(default=None, compare=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to have a non-nullable HashInfo, i.e. without
1 and 2 are fine, it'd be safer to avoid 3rd case if we can. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@skshetry it is not, but we allow it. Very good points! I also thought about it, but decided not to mess with it for now. Ideally thinking about making this dataclass read-only, so everything will be set when creating an instance and so we can put appropriate checks/asserts for such things |
||
|
||
def __bool__(self): | ||
return bool(self.value) | ||
|
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.
Will go away in the next PR when we support md5s for external dirs. Just a sanity check for now.