mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 15:28:27 +01:00
Enable parametrization by default (#5018)
* Enable parametrization by default * Remove a way to disable parametrization * Add a comment for the feature flag
This commit is contained in:
@@ -151,7 +151,6 @@ def test_no_commits(tmp_dir):
|
||||
|
||||
|
||||
def test_vars_shows_on_params_diff(tmp_dir, scm, dvc):
|
||||
dvc.config["feature"]["parametrization"] = True
|
||||
params_file = tmp_dir / "test_params.yaml"
|
||||
param_data = {"vars": {"model1": {"epoch": 15}, "model2": {"epoch": 35}}}
|
||||
dump_yaml(params_file, param_data)
|
||||
|
||||
@@ -375,7 +375,6 @@ def test_dvcfile_dump_preserves_comments(tmp_dir, dvc):
|
||||
)
|
||||
def test_dvcfile_try_dumping_parametrized_stage(tmp_dir, dvc, data, name):
|
||||
dump_yaml("dvc.yaml", {"stages": data, "vars": [{"foo": "foobar"}]})
|
||||
dvc.config["feature"]["parametrization"] = True
|
||||
|
||||
stage = dvc.stage.load_one(name=name)
|
||||
dvcfile = stage.dvcfile
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
from dvc.dvcfile import Dvcfile
|
||||
from dvc.stage.loader import StageLoader
|
||||
from dvc.utils.serialize import dumps_yaml
|
||||
from tests.unit.test_stage_resolver import (
|
||||
RESOLVED_DVC_YAML_DATA,
|
||||
TEMPLATED_DVC_YAML_DATA,
|
||||
)
|
||||
|
||||
|
||||
def test_parametrization_is_not_enabled_by_default(tmp_dir, dvc, mocker):
|
||||
assert dvc.config["feature"]["parametrization"] is False
|
||||
|
||||
(tmp_dir / "dvc.yaml").write_text(dumps_yaml(RESOLVED_DVC_YAML_DATA))
|
||||
mock = mocker.patch("dvc.stage.loader.DataResolver")
|
||||
|
||||
stages = list(Dvcfile(dvc, "dvc.yaml").stages)
|
||||
mock.assert_not_called()
|
||||
assert len(stages) == 2
|
||||
|
||||
|
||||
def test_parametrization_flag_when_enabled(tmp_dir, dvc, mocker):
|
||||
dvc.config["feature"]["parametrization"] = True
|
||||
|
||||
dvcfile = Dvcfile(dvc, "dvc.yaml")
|
||||
loader = StageLoader(dvcfile, TEMPLATED_DVC_YAML_DATA, lockfile_data=None)
|
||||
loader.resolved_data = RESOLVED_DVC_YAML_DATA["stages"]
|
||||
|
||||
stages = list(loader.values())
|
||||
assert len(stages) == 2
|
||||
@@ -147,7 +147,6 @@ def test_collect_not_a_group_stage_with_group_flag(tmp_dir, dvc, stages):
|
||||
|
||||
|
||||
def test_collect_generated(tmp_dir, dvc):
|
||||
dvc.config["feature"]["parametrization"] = True
|
||||
d = {
|
||||
"vars": [{"vars": [1, 2, 3, 4, 5]}],
|
||||
"stages": {
|
||||
|
||||
Reference in New Issue
Block a user