Skip to content
Merged
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
17 changes: 15 additions & 2 deletions airflow/providers/amazon/aws/operators/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from airflow.configuration import conf
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
from airflow.models import BaseOperator
from airflow.models.mappedoperator import MappedOperator
from airflow.providers.amazon.aws.hooks.batch_client import BatchClientHook
from airflow.providers.amazon.aws.links.batch import (
BatchJobDefinitionLink,
Expand Down Expand Up @@ -126,9 +127,21 @@ class BatchOperator(BaseOperator):
@property
def operator_extra_links(self):
op_extra_links = [BatchJobDetailsLink()]
if self.wait_for_completion:

if isinstance(self, MappedOperator):
wait_for_completion = self.partial_kwargs.get(
"wait_for_completion"
) or self.expand_input.value.get("wait_for_completion")
array_properties = self.partial_kwargs.get("array_properties") or self.expand_input.value.get(
"array_properties"
)
else:
wait_for_completion = self.wait_for_completion
array_properties = self.array_properties

if wait_for_completion:
op_extra_links.extend([BatchJobDefinitionLink(), BatchJobQueueLink()])
if not self.array_properties:
if not array_properties:
# There is no CloudWatch Link to the parent Batch Job available.
op_extra_links.append(CloudWatchEventsLink())

Expand Down