Skip to content

import: does not work with repositories using params #7307

@pared

Description

@pared

Importing some data from parametrized repository does not work.

reproduction:

#!/bin/bash

set -ex

pushd $TMPDIR

wsp=test_wspace
imp_repo=import_repo
rep=test_repo

rm -rf $wsp && mkdir $wsp && pushd $wsp
base=$(pwd)
mkdir $base/$imp_repo
mkdir $base/$rep

pushd $base/$imp_repo
git init
dvc init

echo data >> data
echo "m: 1" >> params.yaml

dvc add data
dvc run -d data -p m -o out -n train cp data out
git add -A
git commit -am "init"

pushd $base/$rep
git init
dvc init

dvc import $base/$imp_repo out -o my_out -v

Result:

dvc.parsing.ResolveError: failed to parse 'vars' in 'dvc.yaml': 'params.yaml' does not exist

On the first sight the culprit seems to be dvc/repo/stage.py::_maybe_collect_from_dvc_yaml which passes dvc.yaml to StageLoad.load_all, while it seems that it should be a path to the file.
https://github.com/iterative/dvc/blob/d882e21b9b013f69abff960a8bad62d822024b59/dvc/repo/stage.py#L66

Kudos to @oslobowl for discovering the problem.

Metadata

Metadata

Assignees

Labels

A: paramsRelated to dvc paramsA: templatingRelated to the templating featurebugDid we break something?p1-importantImportant, aka current backlog of things to do

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions