uranusjr commented on code in PR #28113:
URL: https://github.com/apache/airflow/pull/28113#discussion_r1040624223


##########
airflow/cli/commands/task_command.py:
##########
@@ -226,7 +227,9 @@ def _run_task_by_executor(args, dag, ti):
         mark_success=args.mark_success,
         pickle_id=pickle_id,
         ignore_all_deps=args.ignore_all_dependencies,
-        ignore_depends_on_past=args.ignore_depends_on_past,
+        ignore_depends_on_past=(
+            args.ignore_depends_on_past or args.depends_on_past == 
PastDependenciesAction.IGNORE
+        ),

Review Comment:
   Is the first part before the `or` ever possible? Since you set a default in 
the parser, this should always be set, is it not?



##########
airflow/cli/cli_parser.py:
##########
@@ -540,9 +541,18 @@ def string_lower_type(val):
 )
 ARG_IGNORE_DEPENDS_ON_PAST = Arg(
     ("-I", "--ignore-depends-on-past"),
-    help="Ignore depends_on_past dependencies (but respect upstream 
dependencies)",
+    help="Deprecated -- use `--depends-on-past ignore` instead. "
+    "Ignore depends_on_past dependencies (but respect upstream dependencies)",
     action="store_true",
 )
+ARG_DEPENDS_ON_PAST = Arg(
+    ("-d", "--depends-on-past"),
+    help="Determine how Airflow should deal with past dependencies. The 
default action is `check`, Airflow "
+    "will check if the the past dependencies are met for the tasks having 
`depends_on_past=True` before run "
+    "them, if `ignore` is provided, the past dependencies will be ignored.",
+    type=PastDependenciesAction,
+    default=PastDependenciesAction.CHECK,
+)

Review Comment:
   I’d be nice to add a `choices` key so argparse can emit better help message.



##########
airflow/cli/cli_parser.py:
##########
@@ -540,9 +541,18 @@ def string_lower_type(val):
 )
 ARG_IGNORE_DEPENDS_ON_PAST = Arg(
     ("-I", "--ignore-depends-on-past"),
-    help="Ignore depends_on_past dependencies (but respect upstream 
dependencies)",
+    help="Deprecated -- use `--depends-on-past ignore` instead. "
+    "Ignore depends_on_past dependencies (but respect upstream dependencies)",
     action="store_true",
 )
+ARG_DEPENDS_ON_PAST = Arg(
+    ("-d", "--depends-on-past"),
+    help="Determine how Airflow should deal with past dependencies. The 
default action is `check`, Airflow "
+    "will check if the the past dependencies are met for the tasks having 
`depends_on_past=True` before run "
+    "them, if `ignore` is provided, the past dependencies will be ignored.",
+    type=PastDependenciesAction,
+    default=PastDependenciesAction.CHECK,
+)

Review Comment:
   It’d be nice to add a `choices` key so argparse can emit better help message.



-- 
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]

Reply via email to