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: 2 additions & 0 deletions airflow/providers/amazon/aws/operators/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def __init__(
self.array_properties = array_properties
self.parameters = parameters or {}
self.retry_strategy = retry_strategy or {}
if not self.retry_strategy.get("attempts", None):
self.retry_strategy["attempts"] = 1
self.waiters = waiters
self.tags = tags or {}
self.wait_for_completion = wait_for_completion
Expand Down
8 changes: 4 additions & 4 deletions tests/providers/amazon/aws/operators/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_init(self):
assert self.batch.hook.max_retries == self.MAX_RETRIES
assert self.batch.hook.status_retries == self.STATUS_RETRIES
assert self.batch.parameters == {}
assert self.batch.retry_strategy == {}
assert self.batch.retry_strategy == {"attempts": 1}
assert self.batch.container_overrides == {}
assert self.batch.array_properties is None
assert self.batch.node_overrides is None
Expand Down Expand Up @@ -146,7 +146,7 @@ def test_execute_without_failures(self, check_mock, wait_mock, job_description_m
containerOverrides={},
jobDefinition="hello-world",
parameters={},
retryStrategy={},
retryStrategy={"attempts": 1},
tags={},
)

Expand All @@ -170,7 +170,7 @@ def test_execute_with_failures(self):
containerOverrides={},
jobDefinition="hello-world",
parameters={},
retryStrategy={},
retryStrategy={"attempts": 1},
tags={},
)

Expand Down Expand Up @@ -237,7 +237,7 @@ def test_override_not_sent_if_not_set(self, client_mock, override):
"jobName": JOB_NAME,
"jobDefinition": "hello-world",
"parameters": {},
"retryStrategy": {},
"retryStrategy": {"attempts": 1},
"tags": {},
}
if override == "overrides":
Expand Down