Skip to content

Commit c758077

Browse files
committed
add database setup debugging
1 parent 9e31834 commit c758077

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

alloydb/notebooks/embeddings_batch_processing.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,19 @@
565565
"async def insert_data(pool):\n",
566566
" async with pool.connect() as db_conn:\n",
567567
" await db_conn.execute(sqlalchemy.text(\"CREATE EXTENSION IF NOT EXISTS vector;\"))\n",
568+
" await db_conn.commit()\n",
569+
" print(\"Enabled vector extension\")\n",
570+
"\n",
568571
" await db_conn.execute(create_table_cmd)\n",
572+
" await db_conn.commit()\n",
573+
" print(f\"Created {table_name} table.\")\n",
574+
"\n",
569575
" await db_conn.execute(\n",
570576
" insert_data_cmd,\n",
571577
" df.to_dict('records'),\n",
572578
" )\n",
573579
" await db_conn.commit()\n",
580+
" print(f\"Inserted {len(df.index)} records into {table_name}.git\")\n",
574581
"\n",
575582
"pool = await init_connection_pool(connector, database_name)\n",
576583
"await insert_data(pool)\n",

0 commit comments

Comments
 (0)