Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion task-sdk/src/airflow/sdk/bases/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def __init__(
raise ValueError(f"pool slots for {self.task_id}{dag_str} cannot be less than 1")
if sla is not None:
warnings.warn(
"The SLA feature is removed in Airflow 3.0, to be replaced with a new implementation in >=3.1",
"The SLA feature is removed in Airflow 3.0, replaced with Deadline Alerts in >=3.1",
stacklevel=2,
)

Expand Down
10 changes: 10 additions & 0 deletions task-sdk/src/airflow/sdk/definitions/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ def __rich_repr__(self):
),
)

sla_miss_callback: None = attrs.field(default=None)
catchup: bool = attrs.field(
factory=_config_bool_factory("scheduler", "catchup_by_default"),
)
Expand Down Expand Up @@ -614,6 +615,15 @@ def _has_on_success_callback(self) -> bool:
def _has_on_failure_callback(self) -> bool:
return self.on_failure_callback is not None

@sla_miss_callback.validator
def _validate_sla_miss_callback(self, _, value):
if value is not None:
warnings.warn(
"The SLA feature is removed in Airflow 3.0, and replaced with a Deadline Alerts in >=3.1",
stacklevel=2,
)
return value

def __repr__(self):
return f"<DAG: {self.dag_id}>"

Expand Down
Loading