Skip to content

Commit dfee838

Browse files
committed
add sleep to avoid some bucket flakiness
1 parent 0e8ece0 commit dfee838

File tree

1 file changed

+61
-7
lines changed

1 file changed

+61
-7
lines changed

notebooks/generative_ai/bq_dataframes_llm_code_generation.ipynb

+61-7
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@
370370
"This section walks through a few steps required in order to use the model in your notebook."
371371
]
372372
},
373+
{
374+
"cell_type": "markdown",
375+
"metadata": {},
376+
"source": []
377+
},
373378
{
374379
"cell_type": "markdown",
375380
"metadata": {
@@ -670,18 +675,39 @@
670675
},
671676
{
672677
"cell_type": "code",
673-
"execution_count": null,
678+
"execution_count": 1,
674679
"metadata": {
675680
"id": "-J5LHgS6LLZ0"
676681
},
677-
"outputs": [],
682+
"outputs": [
683+
{
684+
"name": "stdout",
685+
"output_type": "stream",
686+
"text": [
687+
"Creating gs://code-samples-8094e844-bec3-11ee-8298-4201c0a8181f/...\n"
688+
]
689+
}
690+
],
678691
"source": [
679692
"import uuid\n",
680693
"BUCKET_ID = \"code-samples-\" + str(uuid.uuid1())\n",
681694
"\n",
682695
"!gsutil mb gs://{BUCKET_ID}"
683696
]
684697
},
698+
{
699+
"cell_type": "code",
700+
"execution_count": null,
701+
"metadata": {},
702+
"outputs": [],
703+
"source": [
704+
"import time\n",
705+
"\n",
706+
"# Wait one minute so that the permissions on the new bucket are up-to-date.\n",
707+
"# https://cloud.google.com/storage/docs/consistency#eventually_consistent_operations\n",
708+
"time.sleep(60)"
709+
]
710+
},
685711
{
686712
"cell_type": "markdown",
687713
"metadata": {
@@ -785,16 +811,32 @@
785811
},
786812
{
787813
"cell_type": "code",
788-
"execution_count": null,
814+
"execution_count": 2,
789815
"metadata": {
790816
"id": "iQFo6OUBLmi3"
791817
},
792-
"outputs": [],
818+
"outputs": [
819+
{
820+
"name": "stdout",
821+
"output_type": "stream",
822+
"text": [
823+
"Removing gs://code-samples-8094e844-bec3-11ee-8298-4201c0a8181f/...\n",
824+
"Deleted bucket 'code-samples-8094e844-bec3-11ee-8298-4201c0a8181f'.\n"
825+
]
826+
}
827+
],
793828
"source": [
794-
"# # Delete the Google Cloud Storage bucket and files\n",
795-
"# ! gsutil rm -r gs://{BUCKET_ID}\n",
796-
"# print(f\"Deleted bucket '{BUCKET_ID}'.\")"
829+
"# Delete the Google Cloud Storage bucket and files\n",
830+
"! gsutil rm -r gs://{BUCKET_ID}\n",
831+
"print(f\"Deleted bucket '{BUCKET_ID}'.\")"
797832
]
833+
},
834+
{
835+
"cell_type": "code",
836+
"execution_count": null,
837+
"metadata": {},
838+
"outputs": [],
839+
"source": []
798840
}
799841
],
800842
"metadata": {
@@ -805,6 +847,18 @@
805847
"kernelspec": {
806848
"display_name": "Python 3",
807849
"name": "python3"
850+
},
851+
"language_info": {
852+
"codemirror_mode": {
853+
"name": "ipython",
854+
"version": 3
855+
},
856+
"file_extension": ".py",
857+
"mimetype": "text/x-python",
858+
"name": "python",
859+
"nbconvert_exporter": "python",
860+
"pygments_lexer": "ipython3",
861+
"version": "3.10.9"
808862
}
809863
},
810864
"nbformat": 4,

0 commit comments

Comments
 (0)