You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/07 14:40:43 UTC

[GitHub] [airflow] cansjt commented on a change in pull request #17485: Pass explicit state, not a success boolean

cansjt commented on a change in pull request #17485:
URL: https://github.com/apache/airflow/pull/17485#discussion_r684639842



##########
File path: airflow/models/taskinstance.py
##########
@@ -571,9 +595,24 @@ def log_url(self):
         base_url = conf.get('webserver', 'BASE_URL')
         return base_url + f"/log?execution_date={iso}&task_id={self.task_id}&dag_id={self.dag_id}"
 
+    @property
+    def mark_skipped_url(self):
+        """URL to mark the :class:`.TaskInstance` as skipped"""
+        iso = quote(self.execution_date.isoformat())
+        base_url = conf.get('webserver', 'BASE_URL')
+        return base_url + (
+            "/confirm"
+            f"?task_id={self.task_id}"
+            f"&dag_id={self.dag_id}"
+            f"&execution_date={iso}"
+            "&upstream=false"
+            "&downstream=false"
+            f"&state={State.SKIPPED}"
+        )

Review comment:
       Would this be useful ?

##########
File path: airflow/cli/cli_parser.py
##########
@@ -219,7 +219,16 @@ def _check(value):
 
 # backfill
 ARG_MARK_SUCCESS = Arg(
-    ("-m", "--mark-success"), help="Mark jobs as succeeded without running them", action="store_true"
+    ("-m", "--mark-success"),
+    action="store_const",
+    const='success',
+    dest='mark_as',

Review comment:
       If the definition of those arguments are considered public API, e.g. available for reuse in plugins, then this change is not backward compatible.
   
   But as it is, it avoids having to add boilerplate code to check the arguments values post parsing. Minimizing the changes needed in `airflow/cli/commands/dag_command.py` and `airflow/cli/commands/task_command.py`.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org