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
transfer: add naive objects transfer function #64
Conversation
Codecov Report
@@ Coverage Diff @@
## main #64 +/- ##
==========================================
+ Coverage 50.70% 53.55% +2.84%
==========================================
Files 35 37 +2
Lines 2043 2065 +22
Branches 243 245 +2
==========================================
+ Hits 1036 1106 +70
+ Misses 987 930 -57
- Partials 20 29 +9
Continue to review full report at Codecov.
|
|
||
|
||
def transfer( | ||
src: "ObjectDB", dest: "ObjectDB", oids: Set["str"], jobs: int = None |
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.
There's a question of how oids
will be discovered by the caller. I guess it's a responsibility of odb
.
See iterative/dvc#7874.
from .db import ObjectDB | ||
|
||
|
||
def transfer( |
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.
I'm thinking about whether we even need this function. Based on how we calculate status on dvc-data
side, the logic here will not be reusable there. Although, this will be useful for the naive transfer of objects.
f111f03
to
23a7cc4
Compare
for oid in new: | ||
path = src.oid_to_path(oid) | ||
dest.add(path, src.fs, oid) |
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 add batching support, as soon as ObjectDB.add
gets batching support.
This implements a very naive transfer mechanism without batching (which should be a straightforward change after we have batching in odb.add itself).
This implements a very naive transfer mechanism without
batching (which should be a straightforward change after
we have batching in odb.add itself).