You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Add environment variable configuration to all notebooks
All 21 documentation notebooks now support configuration via environment
variables (DJ_HOST, DJ_USER, DJ_PASS, DJ_PORT) for CI/testing purposes.
Also fixes:
- Remove broken pytest.skip in json-type.ipynb
- Revert CAST(correct AS INTEGER) to sum(correct) in 04-queries.ipynb
(MySQL handles boolean sum natively)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/tutorials/advanced/json-type.ipynb
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@
42
42
}
43
43
},
44
44
"outputs": [],
45
-
"source": "import datajoint as dj\nimport os\n\n# Configure database connection from environment variables (for CI/testing)\nif os.getenv('DJ_HOST'):\n dj.config['database.host'] = os.getenv('DJ_HOST')\nif os.getenv('DJ_PORT'):\n dj.config['database.port'] = int(os.getenv('DJ_PORT'))\nif os.getenv('DJ_USER'):\n dj.config['database.user'] = os.getenv('DJ_USER')\nif os.getenv('DJ_PASS'):\n dj.config['database.password'] = os.getenv('DJ_PASS')\nif os.getenv('DJ_BACKEND'):\n dj.config['database.backend'] = os.getenv('DJ_BACKEND')\n\n# Check if running against PostgreSQL - skip this MySQL-specific tutorial\nimport pytest\nif os.getenv('DJ_BACKEND', '').lower() == 'postgresql':\n pytest.skip(\"JSON tutorial requires MySQL 8.0+ (uses MySQL-specific JSON functions)\", allow_module_level=True)"
45
+
"source": "import datajoint as dj\nimport os\n\n# Configure database connection from environment variables (for CI/testing)\nif os.getenv('DJ_HOST'):\n dj.config['database.host'] = os.getenv('DJ_HOST')\nif os.getenv('DJ_PORT'):\n dj.config['database.port'] = int(os.getenv('DJ_PORT'))\nif os.getenv('DJ_USER'):\n dj.config['database.user'] = os.getenv('DJ_USER')\nif os.getenv('DJ_PASS'):\n dj.config['database.password'] = os.getenv('DJ_PASS')\n\n# Check if running against PostgreSQL - skip this MySQL-specific tutorial"
46
46
},
47
47
{
48
48
"cell_type": "markdown",
@@ -57,9 +57,9 @@
57
57
"id": "a2998c71",
58
58
"metadata": {},
59
59
"source": [
60
-
"For this exercise, let's imagine we work for an awesome company that is organizing a fun RC car race across various teams in the company. Let's see which team has the fastest car! 🏎️\n",
60
+
"For this exercise, let's imagine we work for an awesome company that is organizing a fun RC car race across various teams in the company. Let's see which team has the fastest car! \ud83c\udfce\ufe0f\n",
61
61
"\n",
62
-
"This establishes 2 important entities: a `Team` and a `Car`. Normally the entities are mapped to their own dedicated table, however, let's assume that `Team` is well-structured but `Car` is less structured than we'd prefer. In other words, the structure for what makes up a *car* is varying too much between entries (perhaps because users of the pipeline haven't agreed yet on the definition? 🤷).\n",
62
+
"This establishes 2 important entities: a `Team` and a `Car`. Normally the entities are mapped to their own dedicated table, however, let's assume that `Team` is well-structured but `Car` is less structured than we'd prefer. In other words, the structure for what makes up a *car* is varying too much between entries (perhaps because users of the pipeline haven't agreed yet on the definition? \ud83e\udd37).\n",
63
63
"\n",
64
64
"This would make it a good use-case to keep `Team` as a table but make `Car` a `json` type defined within the `Team` table.\n",
0 commit comments