Skip to content

Commit

Permalink
Add setters to MappedOperator on_*_callbacks (apache#28313)
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-seb authored Dec 13, 2022
1 parent 02c2b2c commit 105dbd2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions airflow/models/mappedoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,18 +450,34 @@ def resources(self) -> Resources | None:
def on_execute_callback(self) -> TaskStateChangeCallback | None:
return self.partial_kwargs.get("on_execute_callback")

@on_execute_callback.setter
def on_execute_callback(self, value: TaskStateChangeCallback | None) -> None:
self.partial_kwargs["on_execute_callback"] = value

@property
def on_failure_callback(self) -> TaskStateChangeCallback | None:
return self.partial_kwargs.get("on_failure_callback")

@on_failure_callback.setter
def on_failure_callback(self, value: TaskStateChangeCallback | None) -> None:
self.partial_kwargs["on_failure_callback"] = value

@property
def on_retry_callback(self) -> TaskStateChangeCallback | None:
return self.partial_kwargs.get("on_retry_callback")

@on_retry_callback.setter
def on_retry_callback(self, value: TaskStateChangeCallback | None) -> None:
self.partial_kwargs["on_retry_callback"] = value

@property
def on_success_callback(self) -> TaskStateChangeCallback | None:
return self.partial_kwargs.get("on_success_callback")

@on_success_callback.setter
def on_success_callback(self, value: TaskStateChangeCallback | None) -> None:
self.partial_kwargs["on_success_callback"] = value

@property
def run_as_user(self) -> str | None:
return self.partial_kwargs.get("run_as_user")
Expand Down

0 comments on commit 105dbd2

Please sign in to comment.