Skip to content

Commit ec1b346

Browse files
authored
Update document_loader.ipynb (#101)
1. Moved "instance id", "database", and "table" values initiation after the "Automatically restart kernel after installs" cell to retain variable values after restart. 2. Adding missing - sign to package install code 3. Set-up GOOGLE_CLOUD_PROJECT env variable, it is needed in the document loader function
1 parent c6203bd commit ec1b346

1 file changed

Lines changed: 24 additions & 17 deletions

File tree

docs/document_loader.ipynb

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,9 @@
2828
"* [Create a Spanner instance](https://cloud.google.com/spanner/docs/create-manage-instances)\n",
2929
"* [Create a Spanner database](https://cloud.google.com/spanner/docs/create-manage-databases)\n",
3030
"* [Create a Spanner table](https://cloud.google.com/spanner/docs/create-query-database-console#create-schema)\n",
31-
"\n",
32-
"After confirmed access to database in the runtime environment of this notebook, filling the following values and run the cell before running example scripts."
33-
]
34-
},
35-
{
36-
"cell_type": "code",
37-
"execution_count": null,
38-
"metadata": {},
39-
"outputs": [],
40-
"source": [
41-
"# @markdown Please specify an instance id, a database, and a table for demo purpose.\n",
42-
"INSTANCE_ID = \"test_instance\" # @param {type:\"string\"}\n",
43-
"DATABASE_ID = \"test_database\" # @param {type:\"string\"}\n",
44-
"TABLE_NAME = \"test_table\" # @param {type:\"string\"}"
31+
"\n"
4532
]
46-
},
33+
},
4734
{
4835
"cell_type": "markdown",
4936
"metadata": {},
@@ -61,7 +48,7 @@
6148
},
6249
"outputs": [],
6350
"source": [
64-
"%pip install -upgrade --quiet langchain-google-spanner langchain"
51+
"%pip install --upgrade --quiet langchain-google-spanner langchain"
6552
]
6653
},
6754
{
@@ -84,6 +71,25 @@
8471
"# app.kernel.do_shutdown(True)"
8572
]
8673
},
74+
{
75+
"cell_type": "markdown",
76+
"metadata": {},
77+
"source": [
78+
"After confirmed access to database in the runtime environment of this notebook, filling the following values and run the cell before running example scripts."
79+
]
80+
},
81+
{
82+
"cell_type": "code",
83+
"execution_count": null,
84+
"metadata": {},
85+
"outputs": [],
86+
"source": [
87+
"# @markdown Please specify an instance id, a database, and a table for demo purpose.\n",
88+
"INSTANCE_ID = \"test_instance\" # @param {type:\"string\"}\n",
89+
"DATABASE_ID = \"test_database\" # @param {type:\"string\"}\n",
90+
"TABLE_NAME = \"test_table\" # @param {type:\"string\"}"
91+
]
92+
},
8793
{
8894
"cell_type": "markdown",
8995
"metadata": {},
@@ -109,7 +115,8 @@
109115
"PROJECT_ID = \"my-project-id\" # @param {type:\"string\"}\n",
110116
"\n",
111117
"# Set the project id\n",
112-
"!gcloud config set project {PROJECT_ID}"
118+
"!gcloud config set project {PROJECT_ID}\n",
119+
"%env GOOGLE_CLOUD_PROJECT={PROJECT_ID}"
113120
]
114121
},
115122
{

0 commit comments

Comments
 (0)