diff --git a/airflow/providers/amazon/aws/triggers/emr.py b/airflow/providers/amazon/aws/triggers/emr.py index 32f9049155910..c09e3565153df 100644 --- a/airflow/providers/amazon/aws/triggers/emr.py +++ b/airflow/providers/amazon/aws/triggers/emr.py @@ -444,8 +444,7 @@ def __init__( waiter_delay: int, waiter_max_attempts: int, ) -> None: - self.hook_instance = EmrServerlessHook(aws_conn_id) - states = list(self.hook_instance.JOB_INTERMEDIATE_STATES.union({"CANCELLING"})) + states = list(EmrServerlessHook.JOB_INTERMEDIATE_STATES.union({"CANCELLING"})) super().__init__( serialized_fields={"application_id": application_id}, waiter_name="no_job_running", @@ -461,4 +460,9 @@ def __init__( ) def hook(self) -> AwsGenericHook: - return self.hook_instance + return EmrServerlessHook(self.aws_conn_id) + + @property + def hook_instance(self) -> AwsGenericHook: + """This property is added for backward compatibility.""" + return self.hook()