-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] dependency: fine grained (user cmd filter) #4363
Conversation
@@ -58,6 +62,21 @@ def file_md5(fname, tree=None): | |||
open_func = open | |||
|
|||
if exists_func(fname): | |||
filtered = None | |||
if cmd: |
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.
not sure if there are aspects of stage.run.cmd_run
which should be used here
if filtered is not None: | ||
from dvc.utils.fs import remove | ||
|
||
remove(filtered) |
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.
not sure if this is required - maybe automatically handled elsewhere (i.e. entire tmpdir deleted before exit)
a469eb4
to
aa4cd31
Compare
|
||
|
||
def _get(stage, p, info): | ||
if isinstance(p, dict): | ||
p = list(p.items()) | ||
assert len(p) == 1 |
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.
maybe assert not required (should be handled by schema)?
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.
Other CLI commands can create/load dependencies, skipping the schema. Good to have an assert.
TODO: insert cmd into dvc.lock
Closing for now, we'll get back after dep/out refactor to properly accommodate this. |
dvc.yaml
dvc.lock
dvc.yaml:stages.<stage>.deps.[].<path>.cmd
)dvc.lock
dvc run -d "utils.py:extract_function.py --name check_db"
Note that this implementation
PARAM_FILTER = "cmd"
path
as a positional argument to the user-definedcmd
cmd
outputcmd: cat
schema:
testing: