dstandish commented on code in PR #32053:
URL: https://github.com/apache/airflow/pull/32053#discussion_r1242399648
##########
airflow/models/abstractoperator.py:
##########
@@ -149,6 +155,92 @@ def dag_id(self) -> str:
def node_id(self) -> str:
return self.task_id
+ @property
+ def is_setup(self):
+ """
+ Whether the operator is a setup task.
+
+ :meta private:
+ """
+ return self._is_setup
+
+ @is_setup.setter
+ def is_setup(self, value):
+ """
+ Setter for is_setup property.
+
+ :meta private:
+ """
+ if self.is_teardown is True and value is True:
+ raise ValueError(f"Cannot mark task '{self.task_id}' as setup;
task is already a teardown.")
+ self._is_setup = value
+
+ @property
+ def is_teardown(self):
+ """
+ Whether the operator is a teardown task.
+
+ :meta private:
+ """
+ return self._is_teardown
+
+ @is_teardown.setter
+ def is_teardown(self, value):
+ """
+ Setter for is_teardown property.
+
+ :meta private:
+ """
+ if self.is_setup is True and value is True:
Review Comment:
needed because it's set to false at init and this should be allowed
--
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]