-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor/test multistage load for params and outputs #3949
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
@@ -87,26 +89,27 @@ def loads_from(stage, s_list, erepo=None): | |||
return ret | |||
|
|||
|
|||
def _parse_params(path_params): |
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.
Moved this function to repo.run()
.
@@ -20,6 +20,19 @@ def is_valid_name(name: str): | |||
return not INVALID_STAGENAME_CHARS & set(name) | |||
|
|||
|
|||
def parse_params(path_params): |
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.
This function outputs same structure as present in pipeline file.
output.load_from_pipeline(stage, [{"key": key}], "outs") | ||
|
||
|
||
def test_plots_load_from_pipeline(dvc): |
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.
There are no tests for new plots
props on dvc.yaml
. Nearly messed up with it.
if not isinstance(params, list): | ||
msg = "Expected list of params for custom params file " | ||
msg += f"'{path}', got '{type(params).__name__}'." | ||
raise ValueError(msg) |
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.
Didn't want to add assertions, so, I have used ValueError. They are purely internal, as error are likely to be raised by schema validators before even reaching here.
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.
Two minor things.
* change DvcParser to print subcommand help * add tests for subcommand help * docstring refactoring * remote: finish separating RemoteTree methods (#3946) * remote: move upload()/download() into tree * remote: move path_info/path_cls into tree * remote.azure: finish moving methods into tree * remote.gs: finish moving methods into tree * remote.hdfs: finish moving methods to tree * remote.http: finish moving methods into tree * remote.oss: finish moving methods into tree * remote.s3: finish moving methods into tree * remote.ssh: finish moving methods into tree * remote.gdrive: finish moving methods into tree * tests: update remote unit tests * tests: update func tests * remote: use walk_files() for all remotes * list_cache_paths() now uses tree.walk_files() for all remotes except local/ssh * fix DS warnings * bugfixes * Unify metrics behavior with dirs (#3935) * run: disable directories for -m/-M flags * run: reformatted string literals * run: simplified metrics check * tests: func: run: dirs as metrics outs * tests: func: run: reformatted string literals * tests: use pytest Co-authored-by: Ruslan Kuprieiev <[email protected]> * refactor/test multistage load for params and outputs (#3949) * refactor multistage load for params and outputs * tests: load params * tests: output loading from pipeline file * fix test * fix typo in name * split params load * rename params func s/inject_values/fill_values * fix tests * simplify loads_params and output.load_from_pipeline * address @pared's suggestions for tests * remote: fix build errors (#3957) * remote: fix remaining gdrive build issues (#3959) * tests: fix gdrive build * remote.gdrive: fix walk_files prefix relpath * change DvcParser to print subcommand help * add tests for subcommand help * docstring refactoring * change tests to pytest-style * remove gettext Co-authored-by: Peter Rowlands (변기호) <[email protected]> Co-authored-by: nik123 <[email protected]> Co-authored-by: Ruslan Kuprieiev <[email protected]> Co-authored-by: Saugat Pachhai <[email protected]>
❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. If the CLI API is changed, I have updated tab completion scripts.
❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)
Thank you for the contribution - we'll try to review it as soon as possible. 🙏
Part of #3693
It's more stricter and better-tested than before.