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/19 23:33:15 UTC
[GitHub] [airflow] GavinDmello opened a new pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
GavinDmello opened a new pull request #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213
---
Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
Make sure to mark the boxes below before creating PR: [x]
- [x] Description above provides context of the change
- [x] Commit message/PR title starts with `[AIRFLOW-NNNN]`. AIRFLOW-NNNN = JIRA ID<sup>*</sup>
- [x] Unit tests coverage for changes (not needed for documentation changes)
- [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [x] Relevant documentation is updated including usage instructions.
- [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
<sup>*</sup> For document-only changes commit message can start with `[AIRFLOW-XXXX]`.
---
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r370668089
##########
File path: airflow/providers/amazon/aws/operators/emr_modify_cluster.py
##########
@@ -0,0 +1,73 @@
+# -*- 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.exceptions import AirflowException
+from airflow.models import BaseOperator
+from airflow.providers.amazon.aws.hooks.emr import EmrHook
+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, cluster_id is pushed to XCom with key cluster_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: str,
+ step_concurrency_level: int,
+ aws_conn_id: str = 'aws_default',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ if cluster_id is None or step_concurrency_level is None:
+ raise AirflowException("'cluster_id' or 'step_concurrency_level' not passed")
Review comment:
@nuclearpinguin Completed the changes you asked for.
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r369299154
##########
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:
@nuclearpinguin I've updated the pull request with the requested changes.
----------------------------------------------------------------
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
[GitHub] [airflow] xinbinhuang commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
xinbinhuang 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_r368766090
##########
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
Review comment:
This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.emr`. see
https://github.com/apache/airflow/blob/bac9bdf5126081f18a47de48e3829079ab4358ba/airflow/contrib/hooks/emr_hook.py
----------------------------------------------------------------
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
[GitHub] [airflow] nuclearpinguin merged pull request #7213: [AIRFLOW-6424]
Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
nuclearpinguin merged pull request #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r369292204
##########
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',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ super().__init__(*args, **kwargs)
+ self.aws_conn_id = aws_conn_id
+ self.cluster_id = cluster_id
+ self.step_concurrency_level = step_concurrency_level
+
+ def execute(self, context):
+ emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+
+ emr = emr_hook.get_conn()
+
+ if self.do_xcom_push:
+ context['ti'].xcom_push(key='cluster_id', value=self.cluster_id)
+
+ self.log.info('Modifying cluster %s', self.cluster_id)
+ response = emr.modify_cluster(ClusterId=self.cluster_id,
Review comment:
The `modify_cluster` is called on the connection returned by the EMR hook, similar to https://github.com/apache/airflow/blob/master/airflow/providers/amazon/aws/operators/emr_add_steps.py#L84
----------------------------------------------------------------
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
[GitHub] [airflow] nuclearpinguin commented on a change in pull request
#7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [airflow] codecov-io edited a comment on issue #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#issuecomment-576474676
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=h1) Report
> Merging [#7213](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/c890d066965aa9dbf3016f41cfae45e9a084478a?src=pr&el=desc) will **decrease** coverage by `1.13%`.
> The diff coverage is `96.29%`.
[](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7213 +/- ##
=========================================
- Coverage 85.34% 84.2% -1.14%
=========================================
Files 791 792 +1
Lines 40128 40155 +27
=========================================
- Hits 34247 33814 -433
- Misses 5881 6341 +460
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...oviders/amazon/aws/operators/emr\_modify\_cluster.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9vcGVyYXRvcnMvZW1yX21vZGlmeV9jbHVzdGVyLnB5) | `96.29% <96.29%> (ø)` | |
| [airflow/operators/mysql\_to\_hive.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9vcGVyYXRvcnMvbXlzcWxfdG9faGl2ZS5weQ==) | `0% <0%> (-100%)` | :arrow_down: |
| [...flow/providers/apache/cassandra/hooks/cassandra.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYXBhY2hlL2Nhc3NhbmRyYS9ob29rcy9jYXNzYW5kcmEucHk=) | `21.51% <0%> (-72.16%)` | :arrow_down: |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/api/auth/backend/kerberos\_auth.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9hcGkvYXV0aC9iYWNrZW5kL2tlcmJlcm9zX2F1dGgucHk=) | `28.16% <0%> (-54.93%)` | :arrow_down: |
| [airflow/providers/redis/operators/redis\_publish.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvcmVkaXMvb3BlcmF0b3JzL3JlZGlzX3B1Ymxpc2gucHk=) | `50% <0%> (-50%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `45.25% <0%> (-46.72%)` | :arrow_down: |
| [airflow/providers/mongo/sensors/mongo.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbW9uZ28vc2Vuc29ycy9tb25nby5weQ==) | `53.33% <0%> (-46.67%)` | :arrow_down: |
| [airflow/providers/mysql/operators/mysql.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvbXlzcWwvb3BlcmF0b3JzL215c3FsLnB5) | `55% <0%> (-45%)` | :arrow_down: |
| ... and [17 more](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=footer). Last update [c890d06...049b5b8](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [airflow] codecov-io edited a comment on issue #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#issuecomment-576474676
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=h1) Report
> Merging [#7213](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/3730c24c41470cd331c5109539ee2fa0c9f4e74a?src=pr&el=desc) will **decrease** coverage by `0.27%`.
> The diff coverage is `96.29%`.
[](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7213 +/- ##
==========================================
- Coverage 85.52% 85.24% -0.28%
==========================================
Files 758 759 +1
Lines 39932 39959 +27
==========================================
- Hits 34150 34064 -86
- Misses 5782 5895 +113
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...oviders/amazon/aws/operators/emr\_modify\_cluster.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9vcGVyYXRvcnMvZW1yX21vZGlmeV9jbHVzdGVyLnB5) | `96.29% <96.29%> (ø)` | |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `45.25% <0%> (-46.72%)` | :arrow_down: |
| [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
| [...rflow/contrib/operators/kubernetes\_pod\_operator.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZF9vcGVyYXRvci5weQ==) | `76.47% <0%> (-21.18%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=footer). Last update [3730c24...bac9bdf](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r369289629
##########
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
Review comment:
Nice catch!
----------------------------------------------------------------
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
[GitHub] [airflow] xinbinhuang commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
xinbinhuang 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_r368766620
##########
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',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ super().__init__(*args, **kwargs)
+ self.aws_conn_id = aws_conn_id
+ self.cluster_id = cluster_id
+ self.step_concurrency_level = step_concurrency_level
+
+ def execute(self, context):
+ emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+
+ emr = emr_hook.get_conn()
+
+ if self.do_xcom_push:
+ context['ti'].xcom_push(key='cluster_id', value=self.cluster_id)
+
+ self.log.info('Modifying cluster %s', self.cluster_id)
+ response = emr.modify_cluster(ClusterId=self.cluster_id,
Review comment:
This method does not seem to exist for the hook. You need to add the actual implementation under the `EmrHook`
----------------------------------------------------------------
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
[GitHub] [airflow] xinbinhuang commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
xinbinhuang 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_r369296507
##########
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',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ super().__init__(*args, **kwargs)
+ self.aws_conn_id = aws_conn_id
+ self.cluster_id = cluster_id
+ self.step_concurrency_level = step_concurrency_level
+
+ def execute(self, context):
+ emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+
+ emr = emr_hook.get_conn()
+
+ if self.do_xcom_push:
+ context['ti'].xcom_push(key='cluster_id', value=self.cluster_id)
+
+ self.log.info('Modifying cluster %s', self.cluster_id)
+ response = emr.modify_cluster(ClusterId=self.cluster_id,
Review comment:
Oh yes, you are right! Sorry about that.
----------------------------------------------------------------
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
[GitHub] [airflow] nuclearpinguin commented on a change in pull request
#7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
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_r368929461
##########
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',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ super().__init__(*args, **kwargs)
+ self.aws_conn_id = aws_conn_id
+ self.cluster_id = cluster_id
+ self.step_concurrency_level = step_concurrency_level
+
+ def execute(self, context):
+ emr_hook = EmrHook(aws_conn_id=self.aws_conn_id)
+
+ emr = emr_hook.get_conn()
+
+ if self.do_xcom_push:
+ context['ti'].xcom_push(key='cluster_id', value=self.cluster_id)
+
+ self.log.info('Modifying cluster %s', self.cluster_id)
+ response = emr.modify_cluster(ClusterId=self.cluster_id,
+ StepConcurrencyLevel=self.step_concurrency_level)
+
+ if not response['ResponseMetadata']['HTTPStatusCode'] == 200:
Review comment:
```suggestion
if response['ResponseMetadata']['HTTPStatusCode'] != 200:
raise ....
self.log.info('Steps concurrency level %d', response['StepConcurrencyLevel'])
return response['StepConcurrencyLevel']
```
----------------------------------------------------------------
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
[GitHub] [airflow] nuclearpinguin commented on a change in pull request
#7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
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_r369500126
##########
File path: airflow/providers/amazon/aws/operators/emr_modify_cluster.py
##########
@@ -0,0 +1,73 @@
+# -*- 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.exceptions import AirflowException
+from airflow.models import BaseOperator
+from airflow.providers.amazon.aws.hooks.emr import EmrHook
+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, cluster_id is pushed to XCom with key cluster_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: str,
+ step_concurrency_level: int,
+ aws_conn_id: str = 'aws_default',
+ *args, **kwargs):
+ if kwargs.get('xcom_push') is not None:
+ raise AirflowException("'xcom_push' was deprecated, use 'do_xcom_push' instead")
+ if cluster_id is None or step_concurrency_level is None:
+ raise AirflowException("'cluster_id' or 'step_concurrency_level' not passed")
Review comment:
This will never happen as `cluster_id` and 'step_concurrency_level` are required parameters. If user don't pass them it will raise TypeError, so we can remove this statement.
----------------------------------------------------------------
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
[GitHub] [airflow] boring-cyborg[bot] commented on issue #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#issuecomment-579293297
Awesome work, congrats on your first merged pull request!
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r369299154
##########
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:
@nuclearpinguin I've updated the pull request.
----------------------------------------------------------------
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
[GitHub] [airflow] codecov-io commented on issue #7213: [AIRFLOW-6424] Added
a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#issuecomment-576474676
# [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=h1) Report
> Merging [#7213](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/3730c24c41470cd331c5109539ee2fa0c9f4e74a?src=pr&el=desc) will **decrease** coverage by `0.27%`.
> The diff coverage is `96.29%`.
[](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #7213 +/- ##
==========================================
- Coverage 85.52% 85.24% -0.28%
==========================================
Files 758 759 +1
Lines 39932 39959 +27
==========================================
- Hits 34150 34064 -86
- Misses 5782 5895 +113
```
| [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [...oviders/amazon/aws/operators/emr\_modify\_cluster.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9wcm92aWRlcnMvYW1hem9uL2F3cy9vcGVyYXRvcnMvZW1yX21vZGlmeV9jbHVzdGVyLnB5) | `96.29% <96.29%> (ø)` | |
| [airflow/kubernetes/volume\_mount.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZV9tb3VudC5weQ==) | `44.44% <0%> (-55.56%)` | :arrow_down: |
| [airflow/kubernetes/volume.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3ZvbHVtZS5weQ==) | `52.94% <0%> (-47.06%)` | :arrow_down: |
| [airflow/kubernetes/pod\_launcher.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3BvZF9sYXVuY2hlci5weQ==) | `45.25% <0%> (-46.72%)` | :arrow_down: |
| [airflow/kubernetes/refresh\_config.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9rdWJlcm5ldGVzL3JlZnJlc2hfY29uZmlnLnB5) | `50.98% <0%> (-23.53%)` | :arrow_down: |
| [...rflow/contrib/operators/kubernetes\_pod\_operator.py](https://codecov.io/gh/apache/airflow/pull/7213/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL29wZXJhdG9ycy9rdWJlcm5ldGVzX3BvZF9vcGVyYXRvci5weQ==) | `76.47% <0%> (-21.18%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=footer). Last update [3730c24...bac9bdf](https://codecov.io/gh/apache/airflow/pull/7213?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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
[GitHub] [airflow] GavinDmello commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
GavinDmello 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_r369299154
##########
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:
@nuclearpinguin I've updated the pull request with changes requested.
----------------------------------------------------------------
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
[GitHub] [airflow] boring-cyborg[bot] commented on issue #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #7213: [AIRFLOW-6424] Added a operator to modify EMR cluster
URL: https://github.com/apache/airflow/pull/7213#issuecomment-576060075
Congratulations on your first Pull Request and welcome to the Apache Airflow community!
If you have any issues or are unsure about any anything please check our
Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:
- Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits](
https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks)
will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory).
Adding a new operator? Check this short [guide](https://github
.com/apache/airflow/blob/master/docs/howto/custom-operator.rst) Consider adding an example DAG that shows
how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing
locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from
Committers.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://apache-airflow-slack.herokuapp.com/
----------------------------------------------------------------
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
[GitHub] [airflow] xinbinhuang commented on a change in pull request #7213:
[AIRFLOW-6424] Added a operator to modify EMR cluster
Posted by GitBox <gi...@apache.org>.
xinbinhuang 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_r368766090
##########
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
Review comment:
This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.emr`.
https://github.com/apache/airflow/blob/bac9bdf5126081f18a47de48e3829079ab4358ba/airflow/contrib/hooks/emr_hook.py
----------------------------------------------------------------
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