Skip to content

Commit

Permalink
Merge pull request #1225 from GoogleCloudPlatform/conteg/bqml-fix
Browse files Browse the repository at this point in the history
Fix on bqml demo
  • Loading branch information
gioconte committed Mar 8, 2023
2 parents 4b108e8 + ca98983 commit b059da8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions blueprints/data-solutions/bq-ml/demo/bmql_pipeline.ipynb
Expand Up @@ -73,15 +73,24 @@
"metadata": {},
"outputs": [],
"source": [
"# Set your variables\n",
"PREFIX = 'your-prefix'\n",
"PROJECT_ID = 'your-project-id'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"DATASET = \"{}_data\".format(PREFIX.replace(\"-\",\"_\")) \n",
"EXPERIMENT_NAME = 'bqml-experiment'\n",
"ENDPOINT_DISPLAY_NAME = 'bqml-endpoint'\n",
"DATASET = \"{}_data\".format(PREFIX.replace(\"-\",\"_\")) \n",
"LOCATION = 'US'\n",
"MODEL_NAME = 'bqml-model'\n",
"PIPELINE_NAME = 'bqml-vertex-pipeline'\n",
"PIPELINE_ROOT = f\"gs://{PREFIX}-data\"\n",
"PREFIX = 'your-prefix'\n",
"PROJECT_ID = 'your-project-id'\n",
"REGION = 'us-central1'\n",
"SERVICE_ACCOUNT = f\"vertex-sa@{PROJECT_ID}.iam.gserviceaccount.com\""
]
Expand Down Expand Up @@ -227,7 +236,6 @@
" project=project_id,\n",
" location=location,\n",
" query=features_query.format(dataset=dataset, project_id=project_id),\n",
" #job_configuration_query = {\"writeDisposition\": \"WRITE_TRUNCATE\"} #, \"destinationTable\":{\"projectId\":project_id,\"datasetId\":dataset,\"tableId\":\"ecommerce_abt_table\"}} #{\"destinationTable\":{\"projectId\":\"project_id\",\"datasetId\":dataset,\"tableId\":\"ecommerce_abt_table\"}}, #\"writeDisposition\": \"WRITE_TRUNCATE\", \n",
"\n",
" ).after(create_dataset)\n",
"\n",
Expand Down Expand Up @@ -408,9 +416,6 @@
"source": [
"# batch prediction on BigQuery\n",
"\n",
"with open(\"sql/explain_predict.sql\") as file:\n",
" explain_predict_query = file.read()\n",
"\n",
"client = bigquery_client = bigquery.Client(location=LOCATION, project=PROJECT_ID)\n",
"batch_predictions = bigquery_client.query(\n",
" explain_predict_query.format(\n",
Expand Down

0 comments on commit b059da8

Please sign in to comment.