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

plots: remove --select CLI option #3840

Merged
merged 2 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions dvc/command/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,12 @@ def _func(self, *args, **kwargs):
raise NotImplementedError

def run(self):
fields = None
jsonpath = None
if self.args.select:
if self.args.select.startswith("$"):
jsonpath = self.args.select
else:
fields = set(self.args.select.split(","))
try:
plots = self._func(
targets=self.args.targets,
template=self.args.template,
fields=fields,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not removing the API part because it is covered by the tests and we will definitely end up using it in the nearest future. Just removing it from CLI so one tries to use it in 1.0.

x_field=self.args.x,
y_field=self.args.y,
path=jsonpath,
csv_header=not self.args.no_csv_header,
title=self.args.title,
x_title=self.args.xlab,
Expand Down Expand Up @@ -128,12 +119,6 @@ def add_parser(subparsers, parent_parser):
plots_show_parser.add_argument(
"-o", "--out", default=None, help="Destination path to save plots to.",
)
plots_show_parser.add_argument(
"-s",
"--select",
default=None,
help="Choose which field(s) or JSONPath to include in the plots.",
)
efiop marked this conversation as resolved.
Show resolved Hide resolved
plots_show_parser.add_argument(
"-x", default=None, help="Field name for x axis."
)
Expand Down Expand Up @@ -192,12 +177,6 @@ def add_parser(subparsers, parent_parser):
plots_diff_parser.add_argument(
"-o", "--out", default=None, help="Destination path to save plots to.",
)
plots_diff_parser.add_argument(
"-s",
"--select",
default=None,
help="Choose which field(s) or JSONPath to include in the plot.",
)
plots_diff_parser.add_argument(
"-x", default=None, help="Field name for x axis."
)
Expand Down
4 changes: 2 additions & 2 deletions scripts/completion/dvc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ _dvc_pipeline_list=''
_dvc_pipeline_show='-c --commands -o --outs --ascii --dot --tree -l --locked'
_dvc_pipeline_show_COMPGEN=_dvc_compgen_DVCFiles
_dvc_plots='show diff'
_dvc_plots_show='-t --template -f --file -s --select -x -y --stdout --no-csv-header --no-html --title --xlab --ylab'
_dvc_plots_diff='-t --template -d --datafile -f --file -s --select -x -y --stdout --no-csv-header --no-html --title --xlab --ylab'
_dvc_plots_show='-t --template -o --out -x -y --show-json --no-csv-header --title --xlab --ylab'
_dvc_plots_diff='-t --template --targets -o --out -x -y --show-json --no-csv-header --title --xlab --ylab'
_dvc_pull='-j --jobs -r --remote -a --all-branches -T --all-tags -f --force -d --with-deps -R --recursive'
_dvc_pull_COMPGEN=_dvc_compgen_DVCFiles
_dvc_push='-j --jobs -r --remote -a --all-branches -T --all-tags -d --with-deps -R --recursive'
Expand Down
8 changes: 0 additions & 8 deletions tests/unit/command/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ def test_metrics_diff(dvc, mocker):
"template",
"--targets",
"datafile",
"--select",
"column1,column2",
"--show-json",
"-x",
"x_field",
Expand Down Expand Up @@ -43,8 +41,6 @@ def test_metrics_diff(dvc, mocker):
targets=["datafile"],
template="template",
revs=["HEAD", "tag1", "tag2"],
fields={"column1", "column2"},
path=None,
x_field="x_field",
y_field="y_field",
csv_header=True,
Expand All @@ -63,8 +59,6 @@ def test_metrics_show(dvc, mocker):
"result.extension",
"-t",
"template",
"-s",
"$.data",
"--show-json",
"--no-csv-header",
"datafile",
Expand All @@ -82,8 +76,6 @@ def test_metrics_show(dvc, mocker):
cmd.repo,
targets=["datafile"],
template="template",
fields=None,
path="$.data",
x_field=None,
y_field=None,
csv_header=False,
Expand Down