mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Make executor info compatible with old versions.
This commit is contained in:
@@ -92,6 +92,9 @@ class ExecutorInfo:
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, d):
|
||||
if "collected" in d:
|
||||
if d.pop("collected"):
|
||||
d["status"] = TaskStatus.FINISHED
|
||||
return cls(**d)
|
||||
|
||||
def asdict(self):
|
||||
|
||||
@@ -93,3 +93,16 @@ def test_workspace_executor_failed_status(
|
||||
else:
|
||||
executor_info = ExecutorInfo.load_json(infofile)
|
||||
assert executor_info.status == TaskStatus.FAILED
|
||||
|
||||
|
||||
def test_executor_status_compatiblity():
|
||||
data = {
|
||||
"git_url": "file:///Users/home",
|
||||
"baseline_rev": "123",
|
||||
"location": "dvc-task",
|
||||
"root_dir": "/Users/home/8088/.dvc/tmp/exps/tmpx85892cx",
|
||||
"dvc_dir": ".dvc",
|
||||
"collected": True,
|
||||
}
|
||||
result = ExecutorInfo.from_dict(data)
|
||||
assert result.status == TaskStatus.FINISHED
|
||||
|
||||
Reference in New Issue
Block a user