From 90aaf5a29633674bfc54c289cda06c8f09e20ac3 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Thu, 18 May 2023 16:36:14 +0545 Subject: [PATCH] commands: remove --show-json/--show-md/--show-csv flags (#9475) --- dvc/commands/dag.py | 1 - dvc/commands/data.py | 8 -------- dvc/commands/data_sync.py | 1 - dvc/commands/diff.py | 2 -- dvc/commands/experiments/diff.py | 2 -- dvc/commands/experiments/save.py | 1 - dvc/commands/experiments/show.py | 3 --- dvc/commands/ls/__init__.py | 1 - dvc/commands/metrics.py | 4 ---- dvc/commands/params.py | 2 -- dvc/commands/plots.py | 1 - tests/unit/command/test_compat_flag.py | 20 -------------------- 12 files changed, 46 deletions(-) diff --git a/dvc/commands/dag.py b/dvc/commands/dag.py index ae9dcdc62..1e8d76a99 100644 --- a/dvc/commands/dag.py +++ b/dvc/commands/dag.py @@ -176,7 +176,6 @@ def add_parser(subparsers, parent_parser): ) dag_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", diff --git a/dvc/commands/data.py b/dvc/commands/data.py index 2c09cf6cf..68cab068d 100644 --- a/dvc/commands/data.py +++ b/dvc/commands/data.py @@ -217,13 +217,6 @@ def add_parser(subparsers, parent_parser): default=False, help="Show output in JSON format.", ) - data_status_parser.add_argument( - "--show-json", - action="store_true", - default=False, - dest="json", - help=argparse.SUPPRESS, - ) data_status_parser.add_argument( "--granular", action="store_true", @@ -269,7 +262,6 @@ def add_parser(subparsers, parent_parser): ) data_ls_parser.add_argument( "--md", - "--show-md", dest="markdown", action="store_true", default=False, diff --git a/dvc/commands/data_sync.py b/dvc/commands/data_sync.py index a04b8f602..aab2a6459 100644 --- a/dvc/commands/data_sync.py +++ b/dvc/commands/data_sync.py @@ -403,7 +403,6 @@ def add_parser(subparsers, _parent_parser): ) status_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show status in JSON format.", diff --git a/dvc/commands/diff.py b/dvc/commands/diff.py index 9ab14983f..4592af6e7 100644 --- a/dvc/commands/diff.py +++ b/dvc/commands/diff.py @@ -184,7 +184,6 @@ def add_parser(subparsers, parent_parser): ) diff_parser.add_argument( "--json", - "--show-json", help="Format the output into a JSON", action="store_true", default=False, @@ -197,7 +196,6 @@ def add_parser(subparsers, parent_parser): ) diff_parser.add_argument( "--md", - "--show-md", help="Show tabulated output in the Markdown format (GFM).", action="store_true", dest="markdown", diff --git a/dvc/commands/experiments/diff.py b/dvc/commands/experiments/diff.py index 674535f5c..c9a88e17b 100644 --- a/dvc/commands/experiments/diff.py +++ b/dvc/commands/experiments/diff.py @@ -83,14 +83,12 @@ def add_parser(experiments_subparsers, parent_parser): ) experiments_diff_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show output in JSON format.", ) experiments_diff_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", diff --git a/dvc/commands/experiments/save.py b/dvc/commands/experiments/save.py index a285fd994..227aa0f90 100644 --- a/dvc/commands/experiments/save.py +++ b/dvc/commands/experiments/save.py @@ -53,7 +53,6 @@ def add_parser(experiments_subparsers, parent_parser): ) save_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show output in JSON format.", diff --git a/dvc/commands/experiments/show.py b/dvc/commands/experiments/show.py index b94baf5ce..f441393e1 100644 --- a/dvc/commands/experiments/show.py +++ b/dvc/commands/experiments/show.py @@ -316,21 +316,18 @@ def add_parser(experiments_subparsers, parent_parser): ) experiments_show_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Print output in JSON format instead of a human-readable table.", ) experiments_show_parser.add_argument( "--csv", - "--show-csv", action="store_true", default=False, help="Print output in csv format instead of a human-readable table.", ) experiments_show_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", diff --git a/dvc/commands/ls/__init__.py b/dvc/commands/ls/__init__.py index 1bc7e68a4..e293dbe55 100644 --- a/dvc/commands/ls/__init__.py +++ b/dvc/commands/ls/__init__.py @@ -71,7 +71,6 @@ def add_parser(subparsers, parent_parser): ) list_parser.add_argument( "--json", - "--show-json", action="store_true", help="Show output in JSON format.", ) diff --git a/dvc/commands/metrics.py b/dvc/commands/metrics.py index 772630244..ed46bef3f 100644 --- a/dvc/commands/metrics.py +++ b/dvc/commands/metrics.py @@ -140,14 +140,12 @@ def add_parser(subparsers, parent_parser): ) metrics_show_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show output in JSON format.", ) metrics_show_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", @@ -223,14 +221,12 @@ def add_parser(subparsers, parent_parser): ) metrics_diff_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show output in JSON format.", ) metrics_diff_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", diff --git a/dvc/commands/params.py b/dvc/commands/params.py index dfdf68218..41b66a0a0 100644 --- a/dvc/commands/params.py +++ b/dvc/commands/params.py @@ -105,14 +105,12 @@ def add_parser(subparsers, parent_parser): ) params_diff_parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help="Show output in JSON format.", ) params_diff_parser.add_argument( "--md", - "--show-md", action="store_true", default=False, dest="markdown", diff --git a/dvc/commands/plots.py b/dvc/commands/plots.py index b114ecf43..5d3f3a3ef 100644 --- a/dvc/commands/plots.py +++ b/dvc/commands/plots.py @@ -430,7 +430,6 @@ def _add_ui_arguments(parser): ) parser.add_argument( "--json", - "--show-json", action="store_true", default=False, help=argparse.SUPPRESS, diff --git a/tests/unit/command/test_compat_flag.py b/tests/unit/command/test_compat_flag.py index 1adb9d01a..64d6b5437 100644 --- a/tests/unit/command/test_compat_flag.py +++ b/tests/unit/command/test_compat_flag.py @@ -14,28 +14,8 @@ def _id_gen(val) -> str: @pytest.mark.parametrize( "args, key", [ - (["dag", "--show-md"], "markdown"), - (["data", "ls", "--show-md"], "markdown"), - (["diff", "--show-json"], "json"), - (["diff", "--show-md"], "markdown"), - (["experiments", "diff", "--show-json"], "json"), - (["experiments", "diff", "--show-md"], "markdown"), - (["experiments", "show", "--show-json"], "json"), - (["experiments", "show", "--show-csv"], "csv"), - (["experiments", "show", "--show-md"], "markdown"), - (["ls", "--show-json", "."], "json"), - (["metrics", "diff", "--show-json"], "json"), - (["metrics", "diff", "--show-md"], "markdown"), - (["metrics", "show", "--show-json"], "json"), - (["metrics", "show", "--show-md"], "markdown"), - (["params", "diff", "--show-json"], "json"), - (["params", "diff", "--show-md"], "markdown"), - (["status", "--show-json"], "json"), - (["plots", "show", "--show-json"], "json"), - (["plots", "diff", "--show-json"], "json"), (["exp", "list", "--names-only"], "name_only"), (["stage", "list", "--names-only"], "name_only"), - (["data", "status", "--json"], "json"), ], ids=_id_gen, )