From 6fd5eb41853cf5e6a39c29484f8338f9de479c32 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 24 Dec 2019 00:40:07 -0600 Subject: [PATCH] summon: use slice instead of `get` --- dvc/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/api.py b/dvc/api.py index 291c87ce6..23d017427 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -110,7 +110,7 @@ def summon(name, fname=None, args=None, repo=None, rev=None): summon_path = os.path.join(_repo.root_dir, fname) with open(summon_path, "r") as fobj: - objects = ruamel.yaml.safe_load(fobj.read()).get("objects") + objects = ruamel.yaml.safe_load(fobj.read())["objects"] obj = next(x for x in objects if x.get("name") == name) _summon = obj.get("summon") @@ -124,7 +124,7 @@ def summon(name, fname=None, args=None, repo=None, rev=None): out.checkout() with _chdir_and_syspath(_repo.root_dir): - call = _import_string(_summon.get("call")) + call = _import_string(_summon["call"]) _args = copy.deepcopy(_summon["args"]) if args: