Skip to content

Commit

Permalink
Resolving ECS fargate deprecated warnings (apache#39834)
Browse files Browse the repository at this point in the history
* Resolving ECS fargate deprecated warnings
  • Loading branch information
dirrao authored and RNHTTR committed Jun 1, 2024
1 parent 8692993 commit acc6412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions airflow/providers/amazon/aws/operators/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def execute(self, context: Context):
waiter_delay=self.waiter_delay,
waiter_max_attempts=self.waiter_max_attempts,
aws_conn_id=self.aws_conn_id,
region_name=self.region,
region_name=self.region_name,
),
method_name="_complete_exec_with_cluster_desc",
# timeout is set to ensure that if a trigger dies, the timeout does not restart
Expand Down Expand Up @@ -218,7 +218,7 @@ def execute(self, context: Context):
waiter_delay=self.waiter_delay,
waiter_max_attempts=self.waiter_max_attempts,
aws_conn_id=self.aws_conn_id,
region_name=self.region,
region_name=self.region_name,
),
method_name="_complete_exec_with_cluster_desc",
# timeout is set to ensure that if a trigger dies, the timeout does not restart
Expand Down Expand Up @@ -495,7 +495,7 @@ def __init__(
self.number_logs_exception = number_logs_exception

if self.awslogs_region is None:
self.awslogs_region = self.region
self.awslogs_region = self.region_name

self.arn: str | None = None
self._started_by: str | None = None
Expand Down Expand Up @@ -546,7 +546,7 @@ def execute(self, context):
waiter_delay=self.waiter_delay,
waiter_max_attempts=self.waiter_max_attempts,
aws_conn_id=self.aws_conn_id,
region=self.region,
region=self.region_name,
log_group=self.awslogs_group,
log_stream=self._get_logs_stream_name(),
),
Expand Down Expand Up @@ -589,7 +589,7 @@ def execute_complete(self, context: Context, event: dict[str, Any] | None = None
self._after_execution()
if self._aws_logs_enabled():
# same behavior as non-deferrable mode, return last line of logs of the task.
logs_client = AwsLogsHook(aws_conn_id=self.aws_conn_id, region_name=self.region).conn
logs_client = AwsLogsHook(aws_conn_id=self.aws_conn_id, region_name=self.region_name).conn
one_log = logs_client.get_log_events(
logGroupName=self.awslogs_group,
logStreamName=self._get_logs_stream_name(),
Expand Down
1 change: 0 additions & 1 deletion tests/always/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
# Generally, these should be resolved as soon as a parameter or operator is deprecated.
# If the deprecation is postponed, the item should be added to this tuple,
# and a corresponding Issue should be created on GitHub.
"tests/system/providers/amazon/aws/example_ecs_fargate.py",
"tests/system/providers/amazon/aws/example_emr_notebook_execution.py",
"tests/system/providers/google/cloud/bigquery/example_bigquery_operations.py",
"tests/system/providers/google/cloud/bigquery/example_bigquery_sensors.py",
Expand Down

0 comments on commit acc6412

Please sign in to comment.