You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/21 10:45:09 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster

nuclearpinguin commented on a change in pull request #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#discussion_r368928456
 
 

 ##########
 File path: airflow/providers/amazon/aws/operators/emr_modify_cluster.py
 ##########
 @@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from airflow.contrib.hooks.emr_hook import EmrHook
+from airflow.exceptions import AirflowException
+from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
+
+
+class EmrModifyClusterOperator(BaseOperator):
+    """
+    An operator that modifies an existing EMR cluster.
+    :param cluster_id: cluster identifier
+    :type cluster_id: str
+    :param step_concurrency_level: Concurrency of the cluster
+    :type step_concurrency_level: int
+    :param aws_conn_id: aws connection to uses
+    :type aws_conn_id: str
+    :param do_xcom_push: if True, job_flow_id is pushed to XCom with key job_flow_id.
+    :type do_xcom_push: bool
+    """
+    template_fields = ['cluster_id', 'step_concurrency_level']
+    template_ext = ()
+    ui_color = '#f9c915'
+
+    @apply_defaults
+    def __init__(
+            self,
+            cluster_id=None,
+            step_concurrency_level=None,
+            aws_conn_id='aws_default',
 
 Review comment:
   Would you like to add type annotations? We are running mypy static analysis and it helps to catch some potential edge cases :)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services