You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2023/08/14 05:51:56 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #33356: Add BranchPythonVirtualenvOperator

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


##########
airflow/operators/python.py:
##########
@@ -623,6 +623,25 @@ def _iter_serializable_context_keys(self):
             yield from self.PENDULUM_SERIALIZABLE_CONTEXT_KEYS
 
 
+class BranchPythonVirtualenvOperator(PythonVirtualenvOperator, SkipMixin):
+    """
+    A workflow can "branch" or follow a path after the execution of this task in a virtualenv.
+    It derives the PythonVirtualenvOperator and expects a Python function that returns
+    a single task_id or list of task_ids to follow. The task_id(s) returned
+    should point to a task directly downstream from {self}. All other "branches"
+    or directly downstream tasks are marked with a state of ``skipped`` so that
+    these paths can't move forward. The ``skipped`` states are propagated
+    downstream to allow for the DAG state to fill up and the DAG run's state
+    to be inferred.
+    """

Review Comment:
   Please follow the D205 rule, see #10742.



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