You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by go...@apache.org on 2025/07/12 18:30:59 UTC

(airflow) branch main updated: Cleanup type ignores in amazon provider where possible (#53239)

This is an automated email from the ASF dual-hosted git repository.

gopidesu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 097133f22c2 Cleanup type ignores in amazon provider where possible (#53239)
097133f22c2 is described below

commit 097133f22c2196653cf6f9ea9995b6b8791a78f5
Author: GPK <go...@gmail.com>
AuthorDate: Sat Jul 12 19:30:51 2025 +0100

    Cleanup type ignores in amazon provider where possible (#53239)
---
 .../src/airflow/providers/amazon/aws/hooks/base_aws.py   | 10 +++++-----
 .../airflow/providers/amazon/aws/hooks/redshift_sql.py   |  2 +-
 .../providers/amazon/aws/log/cloudwatch_task_handler.py  |  2 +-
 .../airflow/providers/amazon/aws/notifications/chime.py  |  2 +-
 .../airflow/providers/amazon/aws/operators/appflow.py    |  4 ++--
 .../airflow/providers/amazon/aws/operators/datasync.py   |  4 ++--
 .../amazon/aws/triggers/opensearch_serverless.py         |  2 +-
 .../src/airflow/providers/amazon/version_compat.py       |  2 +-
 .../system/amazon/aws/example_sagemaker_pipeline.py      |  2 +-
 providers/amazon/tests/unit/amazon/aws/hooks/test_eks.py | 14 +++++++-------
 .../tests/unit/amazon/aws/operators/test_appflow.py      | 12 ++++++------
 .../amazon/tests/unit/amazon/aws/operators/test_ecs.py   | 16 ++++++++--------
 .../amazon/tests/unit/amazon/aws/operators/test_eks.py   |  2 +-
 .../amazon/tests/unit/amazon/aws/triggers/test_glue.py   |  4 ++--
 .../amazon/tests/unit/amazon/aws/utils/eks_test_utils.py |  4 ++--
 15 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py b/providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py
index 6cfbd0872f4..832f3d92e31 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/hooks/base_aws.py
@@ -74,7 +74,7 @@ from airflow.utils.log.logging_mixin import LoggingMixin
 # If we change to Union syntax then mypy is not happy with UP007 Use `X | Y` for type annotations
 # The only way to workaround it for now is to keep the union syntax with ignore for mypy
 # We should try to resolve this later.
-BaseAwsConnection = TypeVar("BaseAwsConnection", bound=Union[BaseClient, ServiceResource])  # type: ignore[operator] # noqa: UP007
+BaseAwsConnection = TypeVar("BaseAwsConnection", bound=Union[BaseClient, ServiceResource])  # noqa: UP007
 
 
 if AIRFLOW_V_3_0_PLUS:
@@ -636,7 +636,7 @@ class AwsGenericHook(BaseHook, Generic[BaseAwsConnection]):
                     raise
 
         return AwsConnectionWrapper(
-            conn=connection,  # type: ignore[arg-type]
+            conn=connection,
             region_name=self._region_name,
             botocore_config=self._config,
             verify=self._verify,
@@ -718,10 +718,10 @@ class AwsGenericHook(BaseHook, Generic[BaseAwsConnection]):
         # because the user_agent_extra field is generated at runtime.
         user_agent_config = Config(
             user_agent_extra=self._generate_user_agent_extra_field(
-                existing_user_agent_extra=config.user_agent_extra  # type: ignore[union-attr]
+                existing_user_agent_extra=config.user_agent_extra
             )
         )
-        return config.merge(user_agent_config)  # type: ignore[union-attr]
+        return config.merge(user_agent_config)
 
     def get_client_type(
         self,
@@ -1050,7 +1050,7 @@ class AwsGenericHook(BaseHook, Generic[BaseAwsConnection]):
             return WaiterModel(model_config).waiter_names
 
 
-class AwsBaseHook(AwsGenericHook[Union[boto3.client, boto3.resource]]):  # type: ignore[operator] # noqa: UP007
+class AwsBaseHook(AwsGenericHook[Union[boto3.client, boto3.resource]]):  # noqa: UP007
     """
     Base class for interact with AWS.
 
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py b/providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py
index bdd90f1d6ba..76e71eafb4b 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py
@@ -74,7 +74,7 @@ class RedshiftSQLHook(DbApiHook):
 
     @cached_property
     def conn(self):
-        return self.get_connection(self.redshift_conn_id)  # type: ignore[attr-defined]
+        return self.get_connection(self.redshift_conn_id)
 
     def _get_conn_params(self) -> dict[str, str | int]:
         """Retrieve connection parameters."""
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py b/providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py
index 0961b091a58..543b0d33cea 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py
@@ -169,7 +169,7 @@ class CloudWatchRemoteLogIO(LoggingMixin):  # noqa: D101
             f"Reading remote log from Cloudwatch log_group: {self.log_group} log_stream: {relative_path}"
         ]
         try:
-            logs = [self.get_cloudwatch_logs(relative_path, ti)]  # type: ignore[arg-value]
+            logs = [self.get_cloudwatch_logs(relative_path, ti)]
         except Exception as e:
             logs = None
             messages.append(str(e))
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/notifications/chime.py b/providers/amazon/src/airflow/providers/amazon/aws/notifications/chime.py
index 226b6fbb648..1c2ac5b3ff7 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/notifications/chime.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/notifications/chime.py
@@ -49,7 +49,7 @@ class ChimeNotifier(BaseNotifier):
         """To reduce overhead cache the hook for the notifier."""
         return ChimeWebhookHook(chime_conn_id=self.chime_conn_id)
 
-    def notify(self, context: Context) -> None:  # type: ignore[override]
+    def notify(self, context: Context) -> None:
         """Send a message to a Chime Chat Room."""
         self.hook.send_message(message=self.message)
 
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/operators/appflow.py b/providers/amazon/src/airflow/providers/amazon/aws/operators/appflow.py
index a8f81b28b03..0a1d799866b 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/operators/appflow.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/operators/appflow.py
@@ -468,7 +468,7 @@ class AppflowRecordsShortCircuitOperator(ShortCircuitOperator, AwsBaseHookMixin[
         self.log.info("flow_name: %s", flow_name)
         af_client = self.hook.conn
         task_instance = kwargs["task_instance"]
-        execution_id = task_instance.xcom_pull(task_ids=appflow_task_id, key="execution_id")  # type: ignore
+        execution_id = task_instance.xcom_pull(task_ids=appflow_task_id, key="execution_id")
         if not execution_id:
             raise AirflowException(f"No execution_id found from task_id {appflow_task_id}!")
         self.log.info("execution_id: %s", execution_id)
@@ -494,5 +494,5 @@ class AppflowRecordsShortCircuitOperator(ShortCircuitOperator, AwsBaseHookMixin[
             raise AirflowException(f"Flow ({execution_id}) without recordsProcessed info!")
         records_processed = execution["recordsProcessed"]
         self.log.info("records_processed: %d", records_processed)
-        task_instance.xcom_push("records_processed", records_processed)  # type: ignore
+        task_instance.xcom_push("records_processed", records_processed)
         return records_processed > 0
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/operators/datasync.py b/providers/amazon/src/airflow/providers/amazon/aws/operators/datasync.py
index 83a6e15de13..7b2b7282efc 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/operators/datasync.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/operators/datasync.py
@@ -362,7 +362,7 @@ class DataSyncOperator(AwsBaseOperator[DataSyncHook]):
             aws_domain=DataSyncTaskExecutionLink.get_aws_domain(self.hook.conn_partition),
             region_name=self.hook.conn_region_name,
             task_id=self.task_arn.split("/")[-1],
-            task_execution_id=self.task_execution_arn.split("/")[-1],  # type: ignore[union-attr]
+            task_execution_id=self.task_execution_arn.split("/")[-1],
         )
         DataSyncTaskExecutionLink.persist(
             context=context,
@@ -370,7 +370,7 @@ class DataSyncOperator(AwsBaseOperator[DataSyncHook]):
             region_name=self.hook.conn_region_name,
             aws_partition=self.hook.conn_partition,
             task_id=self.task_arn.split("/")[-1],
-            task_execution_id=self.task_execution_arn.split("/")[-1],  # type: ignore[union-attr]
+            task_execution_id=self.task_execution_arn.split("/")[-1],
         )
 
         self.log.info("You can view this DataSync task execution at %s", execution_url)
diff --git a/providers/amazon/src/airflow/providers/amazon/aws/triggers/opensearch_serverless.py b/providers/amazon/src/airflow/providers/amazon/aws/triggers/opensearch_serverless.py
index fa4966d0a12..3b090b1ad91 100644
--- a/providers/amazon/src/airflow/providers/amazon/aws/triggers/opensearch_serverless.py
+++ b/providers/amazon/src/airflow/providers/amazon/aws/triggers/opensearch_serverless.py
@@ -54,7 +54,7 @@ class OpenSearchServerlessCollectionActiveTrigger(AwsBaseWaiterTrigger):
             serialized_fields={"collection_id": collection_id, "collection_name": collection_name},
             waiter_name="collection_available",
             # waiter_args is a dict[str, Any], allow a possible list of None (it is caught above)
-            waiter_args={"ids": [collection_id]} if collection_id else {"names": [collection_name]},  # type: ignore[list-item]
+            waiter_args={"ids": [collection_id]} if collection_id else {"names": [collection_name]},
             failure_message="OpenSearch Serverless Collection creation failed.",
             status_message="Status of OpenSearch Serverless Collection is",
             status_queries=["status"],
diff --git a/providers/amazon/src/airflow/providers/amazon/version_compat.py b/providers/amazon/src/airflow/providers/amazon/version_compat.py
index befe89d4657..f2e3fdfc6af 100644
--- a/providers/amazon/src/airflow/providers/amazon/version_compat.py
+++ b/providers/amazon/src/airflow/providers/amazon/version_compat.py
@@ -44,7 +44,7 @@ if AIRFLOW_V_3_0_PLUS:
     from airflow.sdk import BaseOperator, BaseOperatorLink, BaseSensorOperator
     from airflow.sdk.execution_time.xcom import XCom
 else:
-    from airflow.models import BaseOperator, XCom  # type: ignore[no-redef]
+    from airflow.models import BaseOperator, XCom
     from airflow.models.baseoperatorlink import BaseOperatorLink  # type: ignore[no-redef]
     from airflow.sensors.base import BaseSensorOperator  # type: ignore[no-redef]
 
diff --git a/providers/amazon/tests/system/amazon/aws/example_sagemaker_pipeline.py b/providers/amazon/tests/system/amazon/aws/example_sagemaker_pipeline.py
index 71949cb151a..3c424c847c9 100644
--- a/providers/amazon/tests/system/amazon/aws/example_sagemaker_pipeline.py
+++ b/providers/amazon/tests/system/amazon/aws/example_sagemaker_pipeline.py
@@ -119,7 +119,7 @@ with DAG(
     chain(
         # TEST SETUP
         test_context,
-        create_pipeline,  # type: ignore[arg-type]
+        create_pipeline,
         # TEST BODY
         start_pipeline1,
         start_pipeline2,
diff --git a/providers/amazon/tests/unit/amazon/aws/hooks/test_eks.py b/providers/amazon/tests/unit/amazon/aws/hooks/test_eks.py
index 569fe59928d..651345485e7 100644
--- a/providers/amazon/tests/unit/amazon/aws/hooks/test_eks.py
+++ b/providers/amazon/tests/unit/amazon/aws/hooks/test_eks.py
@@ -273,7 +273,7 @@ class TestEksHooks:
         with pytest.raises(ClientError) as raised_exception:
             eks_hook.create_cluster(
                 name=generated_test_data.existing_cluster_name,
-                **dict(ClusterInputs.REQUIRED),  # type: ignore
+                **dict(ClusterInputs.REQUIRED),
             )
 
         assert_client_error_exception_thrown(
@@ -434,7 +434,7 @@ class TestEksHooks:
             eks_hook.create_nodegroup(
                 clusterName=non_existent_cluster_name,
                 nodegroupName=non_existent_nodegroup_name,
-                **dict(NodegroupInputs.REQUIRED),  # type: ignore
+                **dict(NodegroupInputs.REQUIRED),
             )
 
         assert_client_error_exception_thrown(
@@ -458,7 +458,7 @@ class TestEksHooks:
             eks_hook.create_nodegroup(
                 clusterName=generated_test_data.cluster_name,
                 nodegroupName=generated_test_data.existing_nodegroup_name,
-                **dict(NodegroupInputs.REQUIRED),  # type: ignore
+                **dict(NodegroupInputs.REQUIRED),
             )
 
         assert_client_error_exception_thrown(
@@ -488,7 +488,7 @@ class TestEksHooks:
                 eks_hook.create_nodegroup(
                     clusterName=generated_test_data.cluster_name,
                     nodegroupName=non_existent_nodegroup_name,
-                    **dict(NodegroupInputs.REQUIRED),  # type: ignore
+                    **dict(NodegroupInputs.REQUIRED),
                 )
 
         assert_client_error_exception_thrown(
@@ -846,7 +846,7 @@ class TestEksHooks:
             eks_hook.create_fargate_profile(
                 clusterName=non_existent_cluster_name,
                 fargateProfileName=non_existent_fargate_profile_name,
-                **dict(FargateProfileInputs.REQUIRED),  # type: ignore
+                **dict(FargateProfileInputs.REQUIRED),
             )
 
         assert_client_error_exception_thrown(
@@ -867,7 +867,7 @@ class TestEksHooks:
             eks_hook.create_fargate_profile(
                 clusterName=generated_test_data.cluster_name,
                 fargateProfileName=generated_test_data.existing_fargate_profile_name,
-                **dict(FargateProfileInputs.REQUIRED),  # type: ignore
+                **dict(FargateProfileInputs.REQUIRED),
             )
 
         assert_client_error_exception_thrown(
@@ -897,7 +897,7 @@ class TestEksHooks:
                 eks_hook.create_fargate_profile(
                     clusterName=generated_test_data.cluster_name,
                     fargateProfileName=non_existent_fargate_profile_name,
-                    **dict(FargateProfileInputs.REQUIRED),  # type: ignore
+                    **dict(FargateProfileInputs.REQUIRED),
                 )
 
         assert_client_error_exception_thrown(
diff --git a/providers/amazon/tests/unit/amazon/aws/operators/test_appflow.py b/providers/amazon/tests/unit/amazon/aws/operators/test_appflow.py
index 6b9d3972eb6..49c49e8c514 100644
--- a/providers/amazon/tests/unit/amazon/aws/operators/test_appflow.py
+++ b/providers/amazon/tests/unit/amazon/aws/operators/test_appflow.py
@@ -119,7 +119,7 @@ def test_run(appflow_conn, ctx, waiter_mock):
     args = DUMP_COMMON_ARGS.copy()
     args.pop("source")
     operator = AppflowRunOperator(**args)
-    operator.execute(ctx)  # type: ignore
+    operator.execute(ctx)
     appflow_conn.start_flow.assert_called_once_with(flowName=FLOW_NAME)
     appflow_conn.describe_flow_execution_records.assert_called_once()
 
@@ -127,7 +127,7 @@ def test_run(appflow_conn, ctx, waiter_mock):
 @pytest.mark.db_test
 def test_run_full(appflow_conn, ctx, waiter_mock):
     operator = AppflowRunFullOperator(**DUMP_COMMON_ARGS)
-    operator.execute(ctx)  # type: ignore
+    operator.execute(ctx)
     run_assertions_base(appflow_conn, [])
 
 
@@ -136,7 +136,7 @@ def test_run_after(appflow_conn, ctx, waiter_mock):
     operator = AppflowRunAfterOperator(
         source_field="col0", filter_date="2022-05-26T00:00+00:00", **DUMP_COMMON_ARGS
     )
-    operator.execute(ctx)  # type: ignore
+    operator.execute(ctx)
     run_assertions_base(
         appflow_conn,
         [
@@ -155,7 +155,7 @@ def test_run_before(appflow_conn, ctx, waiter_mock):
     operator = AppflowRunBeforeOperator(
         source_field="col0", filter_date="2022-05-26T00:00+00:00", **DUMP_COMMON_ARGS
     )
-    operator.execute(ctx)  # type: ignore
+    operator.execute(ctx)
     run_assertions_base(
         appflow_conn,
         [
@@ -174,7 +174,7 @@ def test_run_daily(appflow_conn, ctx, waiter_mock):
     operator = AppflowRunDailyOperator(
         source_field="col0", filter_date="2022-05-26T00:00+00:00", **DUMP_COMMON_ARGS
     )
-    operator.execute(ctx)  # type: ignore
+    operator.execute(ctx)
     run_assertions_base(
         appflow_conn,
         [
@@ -202,7 +202,7 @@ def test_short_circuit(appflow_conn, ctx):
                 flow_name=FLOW_NAME,
                 appflow_run_task_id=TASK_ID,
             )
-            operator.execute(ctx)  # type: ignore
+            operator.execute(ctx)
             appflow_conn.describe_flow_execution_records.assert_called_once_with(
                 flowName=FLOW_NAME, maxResults=100
             )
diff --git a/providers/amazon/tests/unit/amazon/aws/operators/test_ecs.py b/providers/amazon/tests/unit/amazon/aws/operators/test_ecs.py
index f55d4b5bd74..efc6d33630e 100644
--- a/providers/amazon/tests/unit/amazon/aws/operators/test_ecs.py
+++ b/providers/amazon/tests/unit/amazon/aws/operators/test_ecs.py
@@ -359,7 +359,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        self.ecs.execute(mock_context)  # type: ignore[arg-type]
+        self.ecs.execute(mock_context)
 
         client_mock.run_task.assert_called_once_with(
             cluster="c",
@@ -394,7 +394,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
         with pytest.raises(EcsOperatorError):
-            self.ecs.execute(mock_context)  # type: ignore[arg-type]
+            self.ecs.execute(mock_context)
 
         client_mock.run_task.assert_called_once_with(
             cluster="c",
@@ -715,7 +715,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        assert self.ecs.execute(mock_context) == "Log output"  # type: ignore[arg-type]
+        assert self.ecs.execute(mock_context) == "Log output"
 
     @mock.patch.object(EcsBaseOperator, "client")
     @mock.patch("airflow.providers.amazon.aws.utils.task_log_fetcher.AwsTaskLogFetcher")
@@ -728,7 +728,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        assert self.ecs.execute(mock_context) is None  # type: ignore[arg-type]
+        assert self.ecs.execute(mock_context) is None
 
     @mock.patch.object(EcsBaseOperator, "client")
     def test_execute_xcom_with_no_log_fetcher(self, client_mock):
@@ -737,7 +737,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        assert self.ecs.execute(mock_context) is None  # type: ignore[arg-type]
+        assert self.ecs.execute(mock_context) is None
 
     @mock.patch.object(EcsBaseOperator, "client")
     @mock.patch.object(AwsTaskLogFetcher, "get_last_log_message", return_value="Log output")
@@ -747,7 +747,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        assert self.ecs.execute(mock_context) is None  # type: ignore[arg-type]
+        assert self.ecs.execute(mock_context) is None
 
     @mock.patch.object(EcsRunTaskOperator, "client")
     def test_with_defer(self, client_mock):
@@ -759,7 +759,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
         with pytest.raises(TaskDeferred) as deferred:
-            self.ecs.execute(mock_context)  # type: ignore[arg-type]
+            self.ecs.execute(mock_context)
 
         assert isinstance(deferred.value.trigger, TaskDoneTrigger)
         assert deferred.value.trigger.task_arn == f"arn:aws:ecs:us-east-1:012345678910:task/{TASK_ID}"
@@ -772,7 +772,7 @@ class TestEcsRunTaskOperator(EcsBaseTestCase):
         mock_ti = mock.MagicMock()
         mock_context = {"ti": mock_ti, "task_instance": mock_ti}
 
-        self.ecs.execute_complete(mock_context, event)  # type: ignore[arg-type]
+        self.ecs.execute_complete(mock_context, event)
 
         # task gets described to assert its success
         client_mock().describe_tasks.assert_called_once_with(cluster="test_cluster", tasks=["my_arn"])
diff --git a/providers/amazon/tests/unit/amazon/aws/operators/test_eks.py b/providers/amazon/tests/unit/amazon/aws/operators/test_eks.py
index 66cda6292cc..875401955de 100644
--- a/providers/amazon/tests/unit/amazon/aws/operators/test_eks.py
+++ b/providers/amazon/tests/unit/amazon/aws/operators/test_eks.py
@@ -386,7 +386,7 @@ class TestEksCreateClusterOperator:
 
 class TestEksCreateFargateProfileOperator:
     def setup_method(self) -> None:
-        self.create_fargate_profile_params = CreateFargateProfileParams(  # type: ignore
+        self.create_fargate_profile_params = CreateFargateProfileParams(
             cluster_name=CLUSTER_NAME,
             pod_execution_role_arn=POD_EXECUTION_ROLE_ARN[1],
             selectors=SELECTORS[1],
diff --git a/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py b/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
index d9b8ccaa452..4fa6f526835 100644
--- a/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
+++ b/providers/amazon/tests/unit/amazon/aws/triggers/test_glue.py
@@ -54,7 +54,7 @@ class TestGlueJobTrigger:
             waiter_delay=10,
         )
         generator = trigger.run()
-        event = await generator.asend(None)  # type:ignore[attr-defined]
+        event = await generator.asend(None)
 
         assert_expected_waiter_type(mock_get_waiter, "job_complete")
         mock_get_waiter().wait.assert_called_once()
@@ -87,7 +87,7 @@ class TestGlueJobTrigger:
         generator = trigger.run()
 
         with pytest.raises(AirflowException):
-            await generator.asend(None)  # type:ignore[attr-defined]
+            await generator.asend(None)
         assert_expected_waiter_type(mock_get_waiter, "job_complete")
 
     def test_serialization(self):
diff --git a/providers/amazon/tests/unit/amazon/aws/utils/eks_test_utils.py b/providers/amazon/tests/unit/amazon/aws/utils/eks_test_utils.py
index dbf58957279..5f93fc61e74 100644
--- a/providers/amazon/tests/unit/amazon/aws/utils/eks_test_utils.py
+++ b/providers/amazon/tests/unit/amazon/aws/utils/eks_test_utils.py
@@ -58,7 +58,7 @@ def attributes_to_test(
     :param nodegroup_name: The name of the nodegroup under test if applicable.
     :return: Returns a list of tuples containing the keys and values to be validated in testing.
     """
-    result: list[tuple] = deepcopy(inputs.REQUIRED + inputs.OPTIONAL + [STATUS])  # type: ignore
+    result: list[tuple] = deepcopy(inputs.REQUIRED + inputs.OPTIONAL + [STATUS])
     if inputs == ClusterInputs:
         result += [(ClusterAttributes.NAME, cluster_name)]
     elif inputs == FargateProfileInputs:
@@ -178,7 +178,7 @@ def _input_builder(options: InputTypes, minimal: bool) -> dict:
     :param minimal: If True, only the required values are generated; if False all values are generated.
     :return: Returns a dict containing the keys and values to be validated in testing.
     """
-    values: list[tuple] = deepcopy(options.REQUIRED)  # type: ignore
+    values: list[tuple] = deepcopy(options.REQUIRED)
     if not minimal:
         values.extend(deepcopy(options.OPTIONAL))
     return dict(values)  # type: ignore