Skip to content

Commit

Permalink
serialize: use checksums that are already saved (#3708)
Browse files Browse the repository at this point in the history
`get_checksum()` recomputes the checksum which might not match the
pre-recorded one. `checksum` is the one that was `save()`ed during run
and it is the one that should be used in the lockfile.
  • Loading branch information
efiop authored Apr 30, 2020
1 parent af12f0d commit d998c0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dvc/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ def to_lockfile(stage: "PipelineStage") -> dict:
res = {"cmd": stage.cmd}
params, deps = get_params_deps(stage)
deps = [
{"path": dep.def_path, dep.checksum_type: dep.get_checksum()}
for dep in deps
{"path": dep.def_path, dep.checksum_type: dep.checksum} for dep in deps
]
outs = [
{"path": out.def_path, out.checksum_type: out.get_checksum()}
{"path": out.def_path, out.checksum_type: out.checksum}
for out in stage.outs
]
if deps:
Expand Down

0 comments on commit d998c0a

Please sign in to comment.