-
Notifications
You must be signed in to change notification settings - Fork 1.2k
dvc: add Repo(skip_checks) flag #3490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Will skip modified graph checks on add, run and import. The aim is to avoid collecting stages and building graph on these commands. The skip_checks flag is aimed to be private, but let people use dvc on big repos without monkey patching or writing yaml files themselves.
Should be good to go. |
tests/unit/repo/test_repo.py
Outdated
mocker.patch( | ||
"dvc.repo.Repo._collect_graph", | ||
side_effect=Exception("Should not collect"), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to just assert that this wasn't called rather than putting this exception here, as we might have some logic catching this in our code (yes, we don't do that now and catching Exception is a bad thing, but still), which would result in a faulty test. Plus it would be more explicit to use assert not m.called
rather than this unnecessary hack.
) | ||
dvc._skip_graph_checks = True | ||
|
||
tmp_dir.gen("foo", "foo text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also you have dvc_gen
above. Not sure if it is intended.
Will skip modified graph checks on add, run and import. The aim is to
avoid collecting stages and building graph on these commands.
The skip_checks flag is aimed to be private, but let people use dvc on
big repos without monkey patching or writing yaml files themselves.
Closes #2671. For the time being.