Compare commits

...
5 Commits
6 changed files with 25 additions and 7 deletions
+1 -1
View File
@@ -526,7 +526,7 @@ class Output:
entry.path = dep.fs_path
entry.meta = dep.meta
if not entry.obj:
if not dep.obj:
if not dep.obj and dep.files:
dep.obj = dep.get_obj()
entry.obj = dep.obj
return entry
+5 -3
View File
@@ -12,6 +12,7 @@ from typing import (
Optional,
Tuple,
TypedDict,
Union,
cast,
)
@@ -19,10 +20,9 @@ from dvc.fs.git import GitFileSystem
from dvc.ui import ui
if TYPE_CHECKING:
from scmrepo.base import Base
from dvc.output import Output
from dvc.repo import Repo
from dvc.scm import Git, NoSCM
from dvc_data.hashfile.db import HashFileDB
from dvc_data.hashfile.hash_info import HashInfo
from dvc_data.hashfile.obj import HashFile
@@ -140,7 +140,9 @@ class GitInfo(TypedDict, total=False):
is_dirty: bool
def _git_info(scm: "Base", untracked_files: str = "all") -> GitInfo:
def _git_info(
scm: Union["Git", "NoSCM"], untracked_files: str = "all"
) -> GitInfo:
from scmrepo.exceptions import SCMError
from dvc.scm import NoSCM
+4
View File
@@ -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)
+1 -1
View File
@@ -71,7 +71,7 @@ classifiers = [
[project.optional-dependencies]
azure = ["dvc-azure==2.20.4"]
gdrive = ["dvc-gdrive==2.19.0"]
gdrive = ["dvc-gdrive==2.19.1"]
gs = ["dvc-gs==2.20.0"]
hdfs = ["dvc-hdfs==2.19.0; python_version < '3.11'"]
oss = ["dvc-oss==2.19.0"]
@@ -3,4 +3,3 @@ from PyInstaller.utils.hooks import ( # pylint:disable=import-error
)
datas = copy_metadata("pydrive2")
datas += copy_metadata("google-api-python-client")
+14 -1
View File
@@ -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"
)