fix: CI/CD failure (#2123)

* fix: CI/CD failure

* fix: delete dataset
This commit is contained in:
Andrew Ferlitsch
2023-07-28 23:17:40 +00:00
committed by GitHub
parent d48692bd4b
commit 3e89a23166
@@ -620,10 +620,15 @@
")\n",
"# Must be the same region as batch_predict_bq_input_uri\n",
"client = bigquery.Client(project=PROJECT_ID)\n",
"bq_dataset = bigquery.Dataset(batch_predict_bq_output_dataset_path)\n",
"bq_dataset_id = bigquery.Dataset(batch_predict_bq_output_dataset_path)\n",
"dataset_region = \"US\" # @param {type : \"string\"}\n",
"bq_dataset.location = dataset_region\n",
"bq_dataset = client.create_dataset(bq_dataset)\n",
"bq_dataset_id.location = dataset_region\n",
"# delete any existing dataset\n",
"try:\n",
" client.delete_dataset(bq_dataset_id, delete_contents=True)\n",
"except Exception as e:\n",
" print(e)\n",
"bq_dataset = client.create_dataset(bq_dataset_id)\n",
"print(\n",
" \"Created bigquery dataset {} in {}\".format(\n",
" batch_predict_bq_output_dataset_path, dataset_region\n",
@@ -857,6 +862,12 @@
"# Delete batch prediction job\n",
"batch_prediction_job.delete()\n",
"\n",
"# Delete the dataset\n",
"try:\n",
" client.delete_dataset(bq_dataset_id)\n",
"except Exception as e:\n",
" print(e)\n",
"\n",
"# Set this to true only if you'd like to delete your bucket\n",
"delete_bucket = False\n",
"\n",