Skip to content

Commit 9a98197

Browse files
authored
Merge pull request #30 from marklogic/feature/more-notebook-improvements
Added more instructions to the example notebook
2 parents 81b6601 + a8d7512 commit 9a98197

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

examples/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.ipynb_checkpoints

examples/python-blog-post.ipynb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
"import requests\n",
2424
"from requests.auth import HTTPDigestAuth\n",
2525
"\n",
26+
"# The App-Services app server in your MarkLogic instance is assumed to be on port 8000 and to require either 'digest' \n",
27+
"# or 'digestbasic' authentication. If the app server uses a different kind of authentication, you will need to modify \n",
28+
"# the two lines below that set the 'auth' fields for the admin and user sessions. The 'admin_session' is also used to \n",
29+
"# connect to the MarkLogic Manage app server on port 8002, so the authentication strategy should be the same for the \n",
30+
"# Manage and App-Services app servers.\n",
31+
"\n",
2632
"admin_session = requests.Session()\n",
2733
"admin_session.auth = HTTPDigestAuth(adminUser, adminPassword)\n",
2834
"\n",
@@ -221,6 +227,9 @@
221227
"# Retrieve employees as JSON rows using an Optic query, printing the response from MarkLogic.\n",
222228
"# See https://docs.marklogic.com/11.0/guide/optic-guide/en/getting-started-with-optic.html for more information.\n",
223229
"\n",
230+
"# If you run this and receive a \"SQL-TABLEREINDEXING\" error, that is simply because MarkLogic is still indexing the \n",
231+
"# table that was created in the previous cell. Wait a few seconds and then try running the cell again.\n",
232+
"\n",
224233
"optic_query = 'op.fromView(\"example\", \"employee\").where(op.eq(op.col(\"City\"), \"San Jose\"))'\n",
225234
"r = user_session.post(\n",
226235
" f'{base_url}:8000/v1/rows?column-types=header', \n",
@@ -243,7 +252,10 @@
243252
"source": [
244253
"# Retrieve employees as CSV data and create a pandas DataFrame.\n",
245254
"\n",
255+
"# The line below will install pandas; you can remove it if your Python environment already has pandas installed. If you \n",
256+
"# leave it in, you can also ignore any warnings that appear about needing to restart the Jupyter kernel.\n",
246257
"%pip install pandas\n",
258+
"\n",
247259
"import pandas as pd\n",
248260
"import io\n",
249261
"\n",

0 commit comments

Comments
 (0)