diff --git a/dvc/dependency/db.py b/dvc/dependency/db.py index 8655ff21ef..cdbfcbeb52 100644 --- a/dvc/dependency/db.py +++ b/dvc/dependency/db.py @@ -44,6 +44,10 @@ def __init__(self, stage: "Stage", info: dict[str, Any], *args, **kwargs): self.def_path = None # type: ignore[assignment] self.info = info or {} + @property + def is_in_repo(self): + return False + class DbDependency(AbstractDependency): PARAM_CONNECTION = "connection" @@ -70,8 +74,8 @@ def sql(self) -> Optional[str]: return self.db_info.get(self.PARAM_QUERY) or self.db_info.get(self.PARAM_TABLE) def __repr__(self): - return "{}:{}".format( - self.__class__.__name__, "".join(f"{k}=={v}" for k, v in self.info.items()) + return "{}: {}".format( + self.__class__.__name__, "".join(f"{k}={v}" for k, v in self.info.items()) ) def __str__(self): diff --git a/dvc/repo/experiments/serialize.py b/dvc/repo/experiments/serialize.py index e4d2b96c2b..6c9921d4f4 100644 --- a/dvc/repo/experiments/serialize.py +++ b/dvc/repo/experiments/serialize.py @@ -50,7 +50,12 @@ def from_repo( Params, metrics, deps, outs are filled via repo fs/index, all other fields should be passed via kwargs. """ - from dvc.dependency import ParamsDependency, RepoDependency + from dvc.dependency import ( + DatasetDependency, + DbDependency, + ParamsDependency, + RepoDependency, + ) rev = rev or repo.get_rev() assert rev @@ -68,7 +73,10 @@ def from_repo( nfiles=dep.meta.nfiles if dep.meta else None, ) for dep in repo.index.deps - if not isinstance(dep, (ParamsDependency, RepoDependency)) + if not isinstance( + dep, + (ParamsDependency, RepoDependency, DatasetDependency, DbDependency), + ) }, outs={ relpath(out.fs_path, repo.root_dir): ExpOut( diff --git a/dvc/stage/run.py b/dvc/stage/run.py index d193b1b0ec..758fc427ac 100644 --- a/dvc/stage/run.py +++ b/dvc/stage/run.py @@ -154,7 +154,11 @@ def cmd_run(stage, dry=False, run_env=None): def _pull_missing_deps(stage): + from dvc.dependency import DatasetDependency, DbDependency + for dep in stage.deps: + if isinstance(dep, (DatasetDependency, DbDependency)): + continue if not dep.exists: stage.repo.pull(dep.def_path)