Skip to content

Commit 9611a0a

Browse files
committed
Improve EMR tutorials #193
1 parent 487214f commit 9611a0a

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

awswrangler/emr.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,10 +649,29 @@ def create_cluster( # pylint: disable=too-many-arguments,too-many-locals,unused
649649
--------
650650
Minimal Example
651651
652+
>>> import awswrangler as wr
652653
>>> cluster_id = wr.emr.create_cluster("SUBNET_ID")
653654
654-
Minimal Exmaple on Docker
655+
Minimal Example With Custom Classification
655656
657+
>>> import awswrangler as wr
658+
>>> cluster_id = wr.emr.create_cluster(
659+
>>> subnet_id="SUBNET_ID",
660+
>>> custom_classifications=[
661+
>>> {
662+
>>> "Classification": "livy-conf",
663+
>>> "Properties": {
664+
>>> "livy.spark.master": "yarn",
665+
>>> "livy.spark.deploy-mode": "cluster",
666+
>>> "livy.server.session.timeout": "16h",
667+
>>> },
668+
>>> }
669+
>>> ],
670+
>>> )
671+
672+
Minimal Example on Docker
673+
674+
>>> import awswrangler as wr
656675
>>> cluster_id = wr.emr.create_cluster(
657676
>>> subnet_id="SUBNET_ID",
658677
>>> spark_docker=True,

testing/test_awswrangler/test_emr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_docker(cloudformation_outputs):
161161
subnet_id=cloudformation_outputs["SubnetId"],
162162
docker=True,
163163
spark_docker=True,
164-
spark_docker_image="787535711150.dkr.ecr.us-east-1.amazonaws.com/docker-emr:docker-emr",
164+
spark_docker_image="123456789123.dkr.ecr.us-east-1.amazonaws.com/docker-emr:docker-emr",
165165
hive_docker=True,
166166
ecr_credentials_step=True,
167167
custom_classifications=[
@@ -174,8 +174,8 @@ def test_docker(cloudformation_outputs):
174174
},
175175
}
176176
],
177-
steps=[wr.emr.build_step("spark-submit --deploy-mode cluster s3://igor-tavares/emr.py")],
177+
steps=[wr.emr.build_step("spark-submit --deploy-mode cluster s3://bucket/emr.py")],
178178
)
179-
wr.emr.submit_step(cluster_id=cluster_id, command="spark-submit --deploy-mode cluster s3://igor-tavares/emr.py")
179+
wr.emr.submit_step(cluster_id=cluster_id, command="spark-submit --deploy-mode cluster s3://bucket/emr.py")
180180
wr.emr.update_ecr_credentials(cluster_id=cluster_id)
181181
wr.emr.terminate_cluster(cluster_id=cluster_id)

tutorials/16 - EMR & Docker.ipynb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@
201201
"metadata": {},
202202
"outputs": [],
203203
"source": [
204-
"step_id = wr.emr.submit_step(cluster_id, command=f\"spark-submit --deploy-mode cluster s3://{bucket}/test_docker.py\")"
204+
"step_id = wr.emr.submit_step(\n",
205+
" cluster_id=cluster_id,\n",
206+
" command=f\"spark-submit --deploy-mode cluster s3://{bucket}/test_docker.py\"\n",
207+
")"
205208
]
206209
},
207210
{
@@ -266,4 +269,4 @@
266269
},
267270
"nbformat": 4,
268271
"nbformat_minor": 4
269-
}
272+
}

0 commit comments

Comments
 (0)