Skip to content

Commit e85ae84

Browse files
expand "Relationships"
1 parent 025d15d commit e85ae84

File tree

5 files changed

+506
-112
lines changed

5 files changed

+506
-112
lines changed

book/00-introduction/00-purpose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors:
77

88
# Introducing DataJoint
99

10-
This book is a comprehensive guide to DataJoint for Python, a specialized framework designed to implement scientific data pipelines that manage data and orchestrate computations in collaborative studies. At its core, DataJoint builds upon the traditional relational database model, enabling scientists, data engineers, and programmers to design and query relational databases. However, DataJoint’s main innovation lies in introducing computational dependencies as a first-class feature within the relational database. This allows researchers to define, execute, and reproduce data processing pipelines with precision and efficiency.
10+
This book is a comprehensive guide to *DataJoint for Python* a specialized framework designed to implement scientific data pipelines that manage data and orchestrate computations in collaborative studies. At its core, DataJoint builds upon the traditional relational database model, enabling scientists, data engineers, and programmers to design and query relational databases. However, DataJoint’s main innovation lies in introducing computational dependencies as a first-class feature within the relational database. This allows researchers to define, execute, and reproduce data processing pipelines with precision and efficiency.
1111

1212
# Purpose of This Book
1313

book/30-schema-design/035-diagrams.ipynb

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"\n",
1010
"Several diagramming notations have been used for designing relational schema, as already introduced in the section on [Relational Theory](../20-concepts/01-relational.md).\n",
1111
"\n",
12-
"DataJoint comes with a powerful diagramming notation that becomes useful for both data modeling in the design phase and for exploring an existing schema."
12+
"DataJoint comes with a powerful diagramming notation that becomes useful for both data modeling and for exploring an existing schema."
1313
]
1414
},
1515
{
@@ -30,15 +30,47 @@
3030
},
3131
{
3232
"cell_type": "code",
33-
"execution_count": 3,
33+
"execution_count": null,
3434
"metadata": {},
35-
"outputs": [],
35+
"outputs": [
36+
{
37+
"name": "stderr",
38+
"output_type": "stream",
39+
"text": [
40+
"[2024-11-01 10:50:30,702][INFO]: Connecting root@localhost:3306\n"
41+
]
42+
},
43+
{
44+
"ename": "OperationalError",
45+
"evalue": "(2003, \"Can't connect to MySQL server on 'localhost' ([Errno 99] Cannot assign requested address)\")",
46+
"output_type": "error",
47+
"traceback": [
48+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
49+
"\u001b[0;31mOSError\u001b[0m Traceback (most recent call last)",
50+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/pymysql/connections.py:649\u001b[0m, in \u001b[0;36mConnection.connect\u001b[0;34m(self, sock)\u001b[0m\n\u001b[1;32m 648\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 649\u001b[0m sock \u001b[38;5;241m=\u001b[39m \u001b[43msocket\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_connection\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 650\u001b[0m \u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mhost\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mport\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect_timeout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\n\u001b[1;32m 651\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 652\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
51+
"File \u001b[0;32m/opt/conda/lib/python3.11/socket.py:863\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, all_errors)\u001b[0m\n\u001b[1;32m 862\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m all_errors:\n\u001b[0;32m--> 863\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions[\u001b[38;5;241m0\u001b[39m]\n\u001b[1;32m 864\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m ExceptionGroup(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcreate_connection failed\u001b[39m\u001b[38;5;124m\"\u001b[39m, exceptions)\n",
52+
"File \u001b[0;32m/opt/conda/lib/python3.11/socket.py:848\u001b[0m, in \u001b[0;36mcreate_connection\u001b[0;34m(address, timeout, source_address, all_errors)\u001b[0m\n\u001b[1;32m 847\u001b[0m sock\u001b[38;5;241m.\u001b[39mbind(source_address)\n\u001b[0;32m--> 848\u001b[0m \u001b[43msock\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43msa\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 849\u001b[0m \u001b[38;5;66;03m# Break explicitly a reference cycle\u001b[39;00m\n",
53+
"\u001b[0;31mOSError\u001b[0m: [Errno 99] Cannot assign requested address",
54+
"\nDuring handling of the above exception, another exception occurred:\n",
55+
"\u001b[0;31mOperationalError\u001b[0m Traceback (most recent call last)",
56+
"Cell \u001b[0;32mIn[1], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mdatajoint\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mdj\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m schema \u001b[38;5;241m=\u001b[39m \u001b[43mdj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mSchema\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mprojects\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;129m@schema\u001b[39m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mclass\u001b[39;00m \u001b[38;5;21;01mEmployee\u001b[39;00m(dj\u001b[38;5;241m.\u001b[39mManual):\n\u001b[1;32m 8\u001b[0m definition \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\"\"\u001b[39m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;124m employee_id : int\u001b[39m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;124m ---\u001b[39m\n\u001b[1;32m 11\u001b[0m \u001b[38;5;124m employee_name : varchar(60)\u001b[39m\n\u001b[1;32m 12\u001b[0m \u001b[38;5;124m \u001b[39m\u001b[38;5;124m\"\"\"\u001b[39m\n",
57+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/schemas.py:77\u001b[0m, in \u001b[0;36mSchema.__init__\u001b[0;34m(self, schema_name, context, connection, create_schema, create_tables, add_objects)\u001b[0m\n\u001b[1;32m 75\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdeclare_list \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 76\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m schema_name:\n\u001b[0;32m---> 77\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mactivate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mschema_name\u001b[49m\u001b[43m)\u001b[49m\n",
58+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/schemas.py:119\u001b[0m, in \u001b[0;36mSchema.activate\u001b[0;34m(self, schema_name, connection, create_schema, create_tables, add_objects)\u001b[0m\n\u001b[1;32m 117\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection \u001b[38;5;241m=\u001b[39m connection\n\u001b[1;32m 118\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 119\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconnection \u001b[38;5;241m=\u001b[39m \u001b[43mconn\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 120\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdatabase \u001b[38;5;241m=\u001b[39m schema_name\n\u001b[1;32m 121\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m create_schema \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
59+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/connection.py:134\u001b[0m, in \u001b[0;36mconn\u001b[0;34m(host, user, password, init_fun, reset, use_tls)\u001b[0m\n\u001b[1;32m 130\u001b[0m init_fun \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m 131\u001b[0m init_fun \u001b[38;5;28;01mif\u001b[39;00m init_fun \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mconnection.init_function\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 132\u001b[0m )\n\u001b[1;32m 133\u001b[0m use_tls \u001b[38;5;241m=\u001b[39m use_tls \u001b[38;5;28;01mif\u001b[39;00m use_tls \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdatabase.use_tls\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m--> 134\u001b[0m conn\u001b[38;5;241m.\u001b[39mconnection \u001b[38;5;241m=\u001b[39m \u001b[43mConnection\u001b[49m\u001b[43m(\u001b[49m\u001b[43mhost\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43muser\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassword\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43minit_fun\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43muse_tls\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 135\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m conn\u001b[38;5;241m.\u001b[39mconnection\n",
60+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/connection.py:196\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, host, user, password, port, init_fun, use_tls)\u001b[0m\n\u001b[1;32m 194\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 195\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_query_cache \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 196\u001b[0m \u001b[43mconnect_host_hook\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 197\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mis_connected:\n\u001b[1;32m 198\u001b[0m logger\u001b[38;5;241m.\u001b[39minfo(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnected \u001b[39m\u001b[38;5;132;01m{user}\u001b[39;00m\u001b[38;5;124m@\u001b[39m\u001b[38;5;132;01m{host}\u001b[39;00m\u001b[38;5;124m:\u001b[39m\u001b[38;5;132;01m{port}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconn_info))\n",
61+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/connection.py:53\u001b[0m, in \u001b[0;36mconnect_host_hook\u001b[0;34m(connection_obj)\u001b[0m\n\u001b[1;32m 49\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m errors\u001b[38;5;241m.\u001b[39mDataJointError(\n\u001b[1;32m 50\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mConnection plugin \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m not found.\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(plugin_name)\n\u001b[1;32m 51\u001b[0m )\n\u001b[1;32m 52\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m---> 53\u001b[0m \u001b[43mconnection_obj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
62+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/datajoint/connection.py:220\u001b[0m, in \u001b[0;36mConnection.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 218\u001b[0m warnings\u001b[38;5;241m.\u001b[39mfilterwarnings(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mignore\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m.*deprecated.*\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 219\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 220\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_conn \u001b[38;5;241m=\u001b[39m \u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 221\u001b[0m \u001b[43m \u001b[49m\u001b[43minit_command\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minit_fun\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 222\u001b[0m \u001b[43m \u001b[49m\u001b[43msql_mode\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mNO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\n\u001b[1;32m 223\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mSTRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION,ONLY_FULL_GROUP_BY\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 224\u001b[0m \u001b[43m \u001b[49m\u001b[43mcharset\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mconnection.charset\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 225\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m{\u001b[49m\n\u001b[1;32m 226\u001b[0m \u001b[43m \u001b[49m\u001b[43mk\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mv\u001b[49m\n\u001b[1;32m 227\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mk\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mv\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconn_info\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mitems\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 228\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mk\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mssl_input\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mhost_input\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[1;32m 229\u001b[0m \u001b[43m \u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 230\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 231\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m client\u001b[38;5;241m.\u001b[39merr\u001b[38;5;241m.\u001b[39mInternalError:\n\u001b[1;32m 232\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_conn \u001b[38;5;241m=\u001b[39m client\u001b[38;5;241m.\u001b[39mconnect(\n\u001b[1;32m 233\u001b[0m init_command\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39minit_fun,\n\u001b[1;32m 234\u001b[0m sql_mode\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 245\u001b[0m },\n\u001b[1;32m 246\u001b[0m )\n",
63+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/pymysql/connections.py:361\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, user, password, host, database, unix_socket, port, charset, collation, sql_mode, read_default_file, conv, use_unicode, client_flag, cursorclass, init_command, connect_timeout, read_default_group, autocommit, local_infile, max_allowed_packet, defer_connect, auth_plugin_map, read_timeout, write_timeout, bind_address, binary_prefix, program_name, server_public_key, ssl, ssl_ca, ssl_cert, ssl_disabled, ssl_key, ssl_key_password, ssl_verify_cert, ssl_verify_identity, compress, named_pipe, passwd, db)\u001b[0m\n\u001b[1;32m 359\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sock \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 360\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 361\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
64+
"File \u001b[0;32m/opt/conda/lib/python3.11/site-packages/pymysql/connections.py:716\u001b[0m, in \u001b[0;36mConnection.connect\u001b[0;34m(self, sock)\u001b[0m\n\u001b[1;32m 714\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m DEBUG:\n\u001b[1;32m 715\u001b[0m \u001b[38;5;28mprint\u001b[39m(exc\u001b[38;5;241m.\u001b[39mtraceback)\n\u001b[0;32m--> 716\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 718\u001b[0m \u001b[38;5;66;03m# If e is neither DatabaseError or IOError, It's a bug.\u001b[39;00m\n\u001b[1;32m 719\u001b[0m \u001b[38;5;66;03m# But raising AssertionError hides original error.\u001b[39;00m\n\u001b[1;32m 720\u001b[0m \u001b[38;5;66;03m# So just reraise it.\u001b[39;00m\n\u001b[1;32m 721\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n",
65+
"\u001b[0;31mOperationalError\u001b[0m: (2003, \"Can't connect to MySQL server on 'localhost' ([Errno 99] Cannot assign requested address)\")"
66+
]
67+
}
68+
],
3669
"source": [
3770
"import datajoint as dj\n",
3871
"\n",
3972
"schema = dj.Schema(\"projects\")\n",
4073
"\n",
41-
"\n",
4274
"@schema\n",
4375
"class Employee(dj.Manual):\n",
4476
" definition = \"\"\"\n",
@@ -71,7 +103,7 @@
71103
},
72104
{
73105
"cell_type": "code",
74-
"execution_count": 5,
106+
"execution_count": null,
75107
"metadata": {},
76108
"outputs": [],
77109
"source": [

0 commit comments

Comments
 (0)