You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "norm (via GitHub)" <gi...@apache.org> on 2023/03/03 11:43:20 UTC

[GitHub] [airflow] norm commented on a diff in pull request #29846: Refactor startup/teardown flag and storage

norm commented on code in PR #29846:
URL: https://github.com/apache/airflow/pull/29846#discussion_r1123383598


##########
airflow/models/abstractoperator.py:
##########
@@ -102,6 +103,12 @@ class AbstractOperator(Templater, DAGNode):
     outlets: list
     inlets: list
 
+    setup_teardown: SetupTeardown | None = None
+    """Indicate whether this is a setup or teadown task.

Review Comment:
   Minor: teardown not teadown (ugh, tea)
   



##########
airflow/utils/setup_teardown.py:
##########
@@ -16,42 +16,49 @@
 # under the License.
 from __future__ import annotations
 
-from contextlib import contextmanager
+import contextlib
+import enum
 
 from airflow.exceptions import AirflowException
 
 
+class SetupTeardown(enum.Enum):
+    """Flag to indicate a setup/teardown context."""
+
+    setup = "setup"
+    teardown = "teardown"

Review Comment:
   Out of curiosity, while I can (almost) follow *what* this is doing, I'm not sure of the *why* — what is the advantage to this refactor?



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