Source code for airflow.providers.amazon.aws.operators.emr_modify_cluster
## 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.fromtypingimportAny,Dictfromairflow.exceptionsimportAirflowExceptionfromairflow.modelsimportBaseOperatorfromairflow.providers.amazon.aws.hooks.emrimportEmrHook
[docs]classEmrModifyClusterOperator(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, cluster_id is pushed to XCom with key cluster_id. :type do_xcom_push: bool """
def__init__(self,*,cluster_id:str,step_concurrency_level:int,aws_conn_id:str='aws_default',**kwargs):ifkwargs.get('xcom_push')isnotNone:raiseAirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")super().__init__(**kwargs)self.aws_conn_id=aws_conn_idself.cluster_id=cluster_idself.step_concurrency_level=step_concurrency_level