Repository: kedro-org/kedro

Issue:
Add deprecation warnings to kedro run flags `--node`, `--tag`, and `--load-version` 
## Description
In the interest of a smoother user experience, the findings of #2014 showed we should switch to using pluralised flags for arguments that accept multiple values. As a result, these singular tags will be replaced, and fully deprecated in 0.19.0. 

Note: Whilst we have deprecated full commands before, we have not added deprecation warnings to individual click options; this ticket may necessitate some research/investigation into how to achieve that.


Discussion:
Can I work on this issue? I am pretty new to this
@jalajk24 Absolutely! Feel free to reach out at any point if you need it 😄 
Hi @jalajk24, thank you for your interest in taking this up! We will take over this ticket due its priority, but feel free to take up any of [the other open issues](https://github.com/kedro-org/kedro/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)!

Resolving patch:
diff --git a/kedro/framework/cli/project.py b/kedro/framework/cli/project.py
--- a/kedro/framework/cli/project.py
+++ b/kedro/framework/cli/project.py
@@ -13,6 +13,7 @@
     KedroCliError,
     _check_module_importable,
     _config_file_callback,
+    _deprecate_options,
     _get_values_as_tuple,
     _reformat_load_versions,
     _split_params,
@@ -339,11 +340,26 @@ def activate_nbstripout(
 @click.option(
     "--to-nodes", type=str, default="", help=TO_NODES_HELP, callback=split_node_names
 )
-@click.option("--node", "-n", "node_names", type=str, multiple=True, help=NODE_ARG_HELP)
+@click.option(
+    "--node",
+    "-n",
+    "node_names",
+    type=str,
+    multiple=True,
+    help=NODE_ARG_HELP,
+    callback=_deprecate_options,
+)
 @click.option("--runner", "-r", type=str, default=None, help=RUNNER_ARG_HELP)
 @click.option("--async", "is_async", is_flag=True, help=ASYNC_ARG_HELP)
 @env_option
-@click.option("--tag", "-t", type=str, multiple=True, help=TAG_ARG_HELP)
+@click.option(
+    "--tag",
+    "-t",
+    type=str,
+    multiple=True,
+    help=TAG_ARG_HELP,
+    callback=_deprecate_options,
+)
 @click.option(
     "--load-version",
     "-lv",
diff --git a/kedro/framework/cli/utils.py b/kedro/framework/cli/utils.py
--- a/kedro/framework/cli/utils.py
+++ b/kedro/framework/cli/utils.py
@@ -422,8 +422,8 @@ def _reformat_load_versions(  # pylint: disable=unused-argument
     """Reformat data structure from tuple to dictionary for `load-version`, e.g.:
     ('dataset1:time1', 'dataset2:time2') -> {"dataset1": "time1", "dataset2": "time2"}.
     """
+    _deprecate_options(ctx, param, value)
     load_versions_dict = {}
-
     for load_version in value:
         load_version_list = load_version.split(":", 1)
         if len(load_version_list) != 2:
@@ -470,3 +470,31 @@ def _split_params(ctx, param, value):
 
 def _get_values_as_tuple(values: Iterable[str]) -> Tuple[str, ...]:
     return tuple(chain.from_iterable(value.split(",") for value in values))
+
+
+def _deprecate_options(ctx, param, value):
+    deprecated_flag = {
+        "node_names": "--node",
+        "tag": "--tag",
+        "load_version": "--load-version",
+    }
+    new_flag = {
+        "node_names": "--nodes",
+        "tag": "--tags",
+        "load_version": "--load-versions",
+    }
+    shorthand_flag = {
+        "node_names": "-n",
+        "tag": "-t",
+        "load_version": "-lv",
+    }
+    if value:
+        deprecation_message = (
+            f"DeprecationWarning: 'kedro run' flag '{deprecated_flag[param.name]}' is deprecated "
+            "and will not be available from Kedro 0.19.0. "
+            f"Use the flag '{new_flag[param.name]}' instead. Shorthand "
+            f"'{shorthand_flag[param.name]}' will be updated to use "
+            f"'{new_flag[param.name]}' in Kedro 0.19.0."
+        )
+        click.secho(deprecation_message, fg="red")
+    return value


Test patch: