Skip to content

Commit

Permalink
refactor fetch revs warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Dec 4, 2023
1 parent 26c471e commit 4a068ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dvc/repo/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def outs_filter(out: "Output") -> bool:
idx.data["repo"].onerror = _make_index_onerror(onerror, rev)

indexes[rev or "workspace"] = idx
except Exception as exc:
if rev == "workspace" and rev not in revs:
except Exception as exc: # noqa: BLE001
if revs and rev == "workspace" and rev not in revs:
continue
if onerror:
onerror(rev, None, exc)
collection_exc = exc
logger.exception("failed to collect '%s'", rev or "workspace")
logger.warning("failed to collect '%s'", rev or "workspace")

if not indexes and collection_exc:
raise collection_exc
Expand Down
2 changes: 1 addition & 1 deletion tests/func/experiments/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,6 @@ def test_push_invalid_workspace(
with open("dvc.yaml", mode="a") as f:
f.write("\ninvalid")

with caplog.at_level(logging.ERROR, logger="dvc"):
with caplog.at_level(logging.WARNING, logger="dvc"):
dvc.experiments.push(git_upstream.remote, push_cache=True)
assert "failed to collect" not in caplog.text

0 comments on commit 4a068ba

Please sign in to comment.