dheerajturaga commented on code in PR #56605:
URL: https://github.com/apache/airflow/pull/56605#discussion_r2434150491
##########
airflow-core/src/airflow/models/mappedoperator.py:
##########
@@ -274,7 +274,7 @@ def priority_weight(self) -> int:
@property
def retry_delay(self) -> datetime.timedelta:
- return self.partial_kwargs["retry_delay"]
+ return self.partial_kwargs.get("retry_delay",
SerializedBaseOperator.retry_delay)
Review Comment:
done
##########
airflow-core/tests/unit/models/test_mappedoperator.py:
##########
@@ -1401,3 +1401,49 @@ def t3(a):
dr.task_instance_scheduling_decisions()
ti3 = dr.get_task_instance(task_id="tg1.t3")
assert not ti3.state
+
+
+def test_mapped_operator_retry_delay_default(dag_maker):
+ """
+ Test that MappedOperator.retry_delay returns default value when not
explicitly set.
+
+ This test verifies the fix for a KeyError that occurred when accessing
retry_delay
+ on a MappedOperator without an explicit retry_delay value in
partial_kwargs.
+ The property should fall back to SerializedBaseOperator.retry_delay (300
seconds).
+ """
+ import datetime
Review Comment:
done
--
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]