Compare commits

...
Author SHA1 Message Date
Andrew FerlitschandGitHub a8d62ed414 Merge branch 'main' into spark_ml_notebook_cleanup 2022-10-11 10:28:24 -07:00
bradmiro 9eb60a3465 minor fixes 2022-10-11 11:15:46 +02:00
@@ -203,7 +203,9 @@
"\n",
"The Spark job executed in this notebook tutorial is compute intensive. Since the job can take a significant amount time to complete in a standard notebook environment, this notebook tutorial runs on a Dataproc cluster that is created with the Dataproc Component Gateway and Jupyter component installed on the cluster.\n",
"\n",
"**Existing Dataproc with Jupyter cluster?**: If you have a running Dataproc cluster that has the [Component Gateway and Jupyter component installed on the cluster](https://cloud.google.com/dataproc/docs/concepts/components/jupyter#gcloud-command), you can use it in this tutorial. If you plan to use it, skip this step, and go to `Switch your kernel`."
"**Existing Dataproc with Jupyter cluster?**: If you have a running Dataproc cluster that has the [Component Gateway and Jupyter component installed on the cluster](https://cloud.google.com/dataproc/docs/concepts/components/jupyter#gcloud-command), you can use it in this tutorial. If you plan to use it, skip this step, and go to `Switch your kernel`.\n",
"\n",
"Set and name and [compute region](https://cloud.google.com/compute/docs/regions-zones#available) for your new cluster. Your `CLUSTER_NAME` must be **unique within your Google Cloud project**. It must start with a lowercase letter, followed by up to 51 lowercase letters, numbers, and hyphens, and cannot end with a hyphen."
]
},
{
@@ -226,15 +228,6 @@
" print(f\"CLUSTER_REGION: {CLUSTER_REGION}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "XoEqT2Y4DJmf"
},
"source": [
"Your `CLUSTER_NAME` must be **unique within your Google Cloud project**. It must start with a lowercase letter, followed by up to 51 lowercase letters, numbers, and hyphens, and cannot end with a hyphen."
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -488,6 +481,15 @@
"from shapely.geometry import Point"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "71ecd729c4b9"
},
"source": [
"**Note**: After importing libraries, if you see `ERROR 1: PROJ: proj_create_from_database: Open of /opt/conda/miniconda3/share/proj failed`, you can ignore it. This is due to a bug with a `geopandas` dependency.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
@@ -519,7 +521,7 @@
"\n",
"# Initialize the SparkSession.\n",
"spark = (\n",
" SparkSession.builder.appName(\"spark-bigquery-polyglot-language-demo\")\n",
" SparkSession.builder.appName(\"spark-ml-taxi-citibike\")\n",
" .config(\"spark.jars\", connector)\n",
" .getOrCreate()\n",
")"
@@ -552,7 +554,7 @@
")\n",
"\n",
"\n",
"# Load NYC_Citibike in Github Acitivity Public dataset from BQ.\n",
"# Load NYC_Citibike in Github Activity Public dataset from BQ.\n",
"bike_df = (\n",
" spark.read.format(\"bigquery\")\n",
" .option(\"table\", \"bigquery-public-data.new_york_citibike.citibike_trips\")\n",
@@ -1553,6 +1555,8 @@
},
"outputs": [],
"source": [
"import os\n",
"\n",
"if not os.getenv(\"IS_TESTING\"):\n",
" ! gcloud dataproc clusters delete $CLUSTER_NAME --region=$CLUSTER_REGION -q"
]