mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
hydra: Raise error when name and sweeps.
This commit is contained in:
@@ -61,6 +61,10 @@ def run(
|
||||
)
|
||||
|
||||
if hydra_sweep:
|
||||
if kwargs.get("name"):
|
||||
raise InvalidArgumentError(
|
||||
"Sweep overrides can't be used alongside `--name`"
|
||||
)
|
||||
from dvc.utils.hydra import get_hydra_sweeps
|
||||
|
||||
sweeps = get_hydra_sweeps(path_overrides)
|
||||
|
||||
@@ -144,5 +144,18 @@ def test_hydra_sweep(
|
||||
|
||||
|
||||
def test_hydra_sweep_requires_queue(params_repo, dvc):
|
||||
with pytest.raises(InvalidArgumentError):
|
||||
with pytest.raises(
|
||||
InvalidArgumentError,
|
||||
match="Sweep overrides can't be used without `--queue`",
|
||||
):
|
||||
dvc.experiments.run(params=["db=mysql,postgresql"])
|
||||
|
||||
|
||||
def test_hydra_sweep_cant_use_name(tmp_dir, params_repo, dvc):
|
||||
with pytest.raises(
|
||||
InvalidArgumentError,
|
||||
match="Sweep overrides can't be used alongside `--name`",
|
||||
):
|
||||
dvc.experiments.run(
|
||||
params=["db=mysql,postgresql"], queue=True, name="foo"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user