Skip to content

Commit

Permalink
dep: repo: handle dict as config (#9853)
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop authored Aug 17, 2023
1 parent 152991d commit 3081c60
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dvc/dependency/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class RepoDependency(Dependency):
Required(PARAM_URL): str,
PARAM_REV: str,
PARAM_REV_LOCK: str,
PARAM_CONFIG: str,
PARAM_CONFIG: Any(str, dict),
PARAM_REMOTE: Any(str, dict),
}
}

def __init__(self, def_repo: Dict[str, str], stage: "Stage", *args, **kwargs):
def __init__(self, def_repo: Dict[str, Any], stage: "Stage", *args, **kwargs):
self.def_repo = def_repo
super().__init__(stage, *args, **kwargs)

Expand Down Expand Up @@ -107,17 +107,17 @@ def _make_fs(

rem = self.def_repo.get("remote")
if isinstance(rem, dict):
remote = None # type: ignore[unreachable]
remote = None
remote_config = rem
else:
remote = rem
remote_config = None

conf = self.def_repo.get("config")
if conf:
config = Config.load_file(conf)
conf = self.def_repo.get("config", {})
if isinstance(conf, dict):
config = conf
else:
config = {}
config = Config.load_file(conf)

config["cache"] = self.repo.config["cache"]
config["cache"]["dir"] = self.repo.cache.local_cache_dir
Expand Down

0 comments on commit 3081c60

Please sign in to comment.