Skip to content
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

params: read from ParamsDependency if possible #5550

Merged
merged 11 commits into from
Apr 12, 2021

Conversation

pared
Copy link
Contributor

@pared pared commented Mar 4, 2021

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Fixes #5451

The change adds new flags: --deps for dvc params diff and --param-deps for dvc exp show/diff in order to show only those parameters that are actually used. It does not change current behaviour.

Related:
iterative/enhancement-proposals#1

Comment on lines -197 to -79
def test_diff_deleted_config(tmp_dir, scm, dvc):
tmp_dir.gen("params.yaml", "foo: bar")
dvc.run(cmd="echo params.yaml", params=["foo"], single_stage=True)
scm.add(["params.yaml", "Dvcfile"])
scm.commit("bar")

(tmp_dir / "params.yaml").unlink()

assert dvc.params.diff() == {
"params.yaml": {"foo": {"old": "bar", "new": None}}
}


Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy of previous test (test_diff_deleted).

Comment on lines 787 to 789
experiments_show_parser.add_argument(
"-t",
"--tracked-params",
Copy link
Contributor

@jorgeorpinel jorgeorpinel Mar 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're all (usually) "tracked", just some by Git. It's more about which ones are stage dependencies I think? So how about --deps or --only-deps (or --param-deps in this case)

Context: #5451 (comment)

@pared pared force-pushed the 5451_track_used branch 2 times, most recently from a04c45b to aa9f780 Compare March 25, 2021 13:54
@pared pared changed the title [WIP] params: read from ParamsDependency if possible params: read from ParamsDependency if possible Mar 25, 2021
@pared pared requested review from jorgeorpinel and pmrowla March 25, 2021 13:56
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names LGTM. One copy edit below (repeated 3 times).

I'm a bit surprised about the amount of logic needed to achieve this at first sight. Would it be easier to make this the default behavior and add option/logic to expand the scope? Well... I guess we have an entire discussion about that somewhere so never mind.

dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/experiments.py Outdated Show resolved Hide resolved
dvc/command/params.py Outdated Show resolved Hide resolved
@pmrowla
Copy link
Contributor

pmrowla commented Mar 29, 2021

LGTM

@pared pared marked this pull request as ready for review March 29, 2021 11:25
@pared pared requested a review from a team March 30, 2021 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

params: untracked values in params files are not ignored in params/exp commands
3 participants