Skip to content

Commit d56f2e7

Browse files
sudoghutclaude
andcommitted
Fix create_views cell: install sqlite3 CLI before running shell script
Colab does not have sqlite3 on PATH by default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fa26f6f commit d56f2e7

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

scripts/setup_cbdb.ipynb

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,7 @@
164164
"metadata": {},
165165
"id": "cell-views",
166166
"outputs": [],
167-
"source": [
168-
"if CREATE_VIEWS:\n",
169-
" import subprocess, os\n",
170-
" script = os.path.join(REPO_DIR, \"scripts\", \"create_views.sh\")\n",
171-
" result = subprocess.run(\n",
172-
" [\"bash\", script, DB_PATH],\n",
173-
" capture_output=True, text=True\n",
174-
" )\n",
175-
" if result.returncode != 0:\n",
176-
" print(result.stderr)\n",
177-
" raise RuntimeError(\"create_views.sh failed — see output above.\")\n",
178-
" lines = result.stdout.splitlines()\n",
179-
" created = sum(1 for l in lines if l.startswith(\"Creating view\"))\n",
180-
" print(f\"Created {created} views.\")\n",
181-
" for line in lines:\n",
182-
" if any(kw in line for kw in (\"ERROR\", \"\", \"All sanity checks\")):\n",
183-
" print(line)\n",
184-
"else:\n",
185-
" print(\"Skipped (CREATE_VIEWS = False).\")"
186-
]
167+
"source": "if CREATE_VIEWS:\n import subprocess, os\n subprocess.run([\"apt-get\", \"install\", \"-y\", \"-q\", \"sqlite3\"], check=True)\n script = os.path.join(REPO_DIR, \"scripts\", \"create_views.sh\")\n result = subprocess.run(\n [\"bash\", script, DB_PATH],\n capture_output=True, text=True\n )\n if result.returncode != 0:\n print(result.stderr)\n raise RuntimeError(\"create_views.sh failed — see output above.\")\n lines = result.stdout.splitlines()\n created = sum(1 for l in lines if l.startswith(\"Creating view\"))\n print(f\"Created {created} views.\")\n for line in lines:\n if any(kw in line for kw in (\"ERROR\", \"\", \"All sanity checks\")):\n print(line)\nelse:\n print(\"Skipped (CREATE_VIEWS = False).\")"
187168
},
188169
{
189170
"cell_type": "markdown",

0 commit comments

Comments
 (0)