vincbeck commented on code in PR #31215:
URL: https://github.com/apache/airflow/pull/31215#discussion_r1191435925
##########
airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -102,10 +104,22 @@ def __init__(
self.waiter_max_attempts = waiter_max_attempts
self.execution_role_arn = execution_role_arn
- def execute(self, context: Context) -> list[str]:
- emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+ @cached_property
+ def hook(self) -> EmrHook:
+ """Create and return an EmrHook."""
+ # Increase the number of max attempts (default 5) because the
AddJobFlowSteps API gets throttled,
+ # replenishment is quite slow.
+ # See https://docs.aws.amazon.com/general/latest/gr/emr.html#limits_emr
+ config = Config(
+ retries={
+ "max_attempts": 10,
Review Comment:
Actually, you can specify that through the connection:
https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/connections/aws.html#avoid-throttling-exceptions.
That makes me think, these changes might override any configuration users
might have set. e.g. Let's say a user specified `max_attempts` to 20 in the
connection configuration, this change is going to override this
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]