dstandish commented on code in PR #32053:
URL: https://github.com/apache/airflow/pull/32053#discussion_r1242398202
##########
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:
+ raise ValueError(f"Cannot mark task '{self.task_id}' as teardown;
task is already a setup.")
+ self._is_teardown = value
+
+ @property
+ def on_failure_fail_dagrun(self):
+ """
+ Whether the operator should fail the dagrun on failure.
+
+ :meta private:
+ """
+ return self._on_failure_fail_dagrun
+
+ @on_failure_fail_dagrun.setter
+ def on_failure_fail_dagrun(self, value):
+ """
+ Setter for on_failure_fail_dagrun property.
+
+ :meta private:
+ """
+ if value is True and self.is_teardown is not True:
Review Comment:
need both because it's a default and it gets set to false when reinitialized
in certain contexts
--
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]