Skip to content

Commit 17c8518

Browse files
committed
get region from boto client
1 parent 896fd1c commit 17c8518

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sagemaker-spark/pyspark_mnist/xgboost_mnist.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,10 @@
8787
},
8888
"outputs": [],
8989
"source": [
90-
"# replace this with your own region, such as us-east-1\n",
91-
"region = 'us-east-1'\n",
90+
"import boto3\n",
91+
"\n",
92+
"# use the region-specific sample data bucket\n",
93+
"region = boto3.Session().region_name\n",
9294
"trainingData = spark.read.format('libsvm')\\\n",
9395
" .option('numFeatures', '784')\\\n",
9496
" .option('vectorType', 'dense')\\\n",

0 commit comments

Comments
 (0)