-
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: use HashInfo #4495
dvc: use HashInfo #4495
Conversation
Related to iterative#4144 , iterative#3069 , iterative#1676
|
||
|
||
@dataclass | ||
class HashInfo: |
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.
Loved this. I was having a lot of issues related to hashes when working with subrepos, mostly my fault but would have made debugging way easier.
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.
Also, a few property
s would make it even better. Eg: is_dir_checksum
? But looks like it's not needed right now.
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.
We should try doing this more in the internals instead of plain dict/tuples/list. Not saying we should use dataclass, but we can use typing.NamedTuple/typing.TypedDict/dataclasses/objects
. 🙂
The one that I can remember right now is StatusInfo
. :)
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.
Also, a few propertys would make it even better. Eg: is_dir_checksum? But looks like it's not needed right now.
Exactly! 🙂 Yeah, just don't want to push everything in this PR. Plus is_dir
actually will require some stuff on index/tree side, so don't want to mix those up. Clearly it will be implemented in the near future though 🙂
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.
We should try doing this more in the internals instead of plain dict/tuples/list. Not saying we should use dataclass, but we can use typing.NamedTuple/typing.TypedDict/dataclasses/objects. slightly_smiling_face
Sorry, didn't get your point.
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.
Sorry, didn't get your point.
Just trying to echo your point, that we should do this more instead of using plain dict/tuples. ⬇️
avoid using explicit tuples
Co-authored-by: Saugat Pachhai <[email protected]>
Initial implementation of HashInfo to avoid using explicit tuples and have a handier way of working with hashes (e.g. comparing hashes of different types).
Related to #4144 , #3069 , #1676
❗ 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. 🙏