o-nikolas commented on code in PR #31960: URL: https://github.com/apache/airflow/pull/31960#discussion_r1232558015
########## airflow/providers/amazon/aws/operators/eks.py: ########## @@ -184,12 +235,12 @@ def execute(self, context: Context): ) ) - eks_hook = EksHook( + self.eks_hook = EksHook( aws_conn_id=self.aws_conn_id, region_name=self.region, ) Review Comment: Now that you have a cool base class, you can add an __init__ to it and create the hook inside of that so that all the child classes don't need to create it each time. ########## airflow/providers/amazon/aws/triggers/eks.py: ########## @@ -33,49 +33,52 @@ class EksCreateFargateProfileTrigger(BaseTrigger): :param cluster_name: The name of the EKS cluster :param fargate_profile_name: The name of the fargate profile - :param poll_interval: The amount of time in seconds to wait between attempts. - :param max_attempts: The maximum number of attempts to be made. + :param waiter_delay: The amount of time in seconds to wait between attempts. Review Comment: Why all the renaming? The PR description doesn't mention this and it seems unrelated to factoring out the create compute method? ########## airflow/providers/amazon/aws/operators/eks.py: ########## @@ -393,51 +416,41 @@ def __init__( ) -> None: self.cluster_name = cluster_name self.pod_execution_role_arn = pod_execution_role_arn + self.fargate_pod_execution_role_arn = pod_execution_role_arn self.selectors = selectors + self.fargate_selectors = selectors self.fargate_profile_name = fargate_profile_name self.create_fargate_profile_kwargs = create_fargate_profile_kwargs or {} - self.wait_for_completion = wait_for_completion + self.wait_for_completion = False if deferrable else wait_for_completion Review Comment: Why is this only done on this operator but not the previous two? ########## airflow/providers/amazon/aws/operators/eks.py: ########## @@ -59,7 +59,52 @@ FARGATE_FULL_NAME = "AWS Fargate profiles" -class EksCreateClusterOperator(BaseOperator): +class BaseEksCreateOperator(BaseOperator): + """ + Base class for EKS Operators that create cluster resources. This includes + EksCreateClusterOperator, EksCreateNodeGroupOperator and EksCreateFargateProfileOperator. + + """ + + def create_compute(cls): Review Comment: This is an instance method, can you s/cls/self/g in all places for this method? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org