justinpakzad commented on code in PR #72590:
URL: https://github.com/apache/airflow/pull/72590#discussion_r3945966195
##########
airflow-ctl/src/airflowctl/ctl/help_texts.yaml:
##########
@@ -15,6 +15,11 @@
# specific language governing permissions and limitations
# under the License.
---
+arguments:
+ reprocess-behavior: >-
+ Select which Dag runs to create: 'none' (Missing Runs), 'failed' (Missing
and Errored Runs),
+ or 'completed' (All Runs). Default is 'none'.
+
Review Comment:
I don't think this is the right approach. The help texts are a group ->
subcommand -> description map and this adds a different kind of mapping
(argument help) into the file which is only used for one specific argument flag.
##########
airflow-ctl/src/airflowctl/ctl/cli_config.py:
##########
@@ -725,10 +726,12 @@ def _create_arg_for_non_primitive_type(
commands.append(
self._create_arg(
-
arg_flags=(f"--{self._sanitize_arg_parameter_key(field)}",),
+ arg_flags=(f"--{sanitized_field}",),
arg_type=self._python_type_from_string(annotation),
arg_action=argparse.BooleanOptionalAction if annotation is
bool else None, # type: ignore
- arg_help=f"{field} for {parameter_key} operation",
+ arg_help=self.help_texts.get("arguments", {}).get(
Review Comment:
Related to my comment about the help texts. This runs `.get("arguments",
{})...` on every generated flag but it's only ever resolved for this one
argument.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]