Skip to content

Commit fe5f749

Browse files
Merge pull request #465 from eywalker/master
Suppress MySQL mode related warnings
2 parents 12ad9d6 + ce519aa commit fe5f749

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

datajoint/connection.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ def connect(self):
8989
"""
9090
Connects to the database server.
9191
"""
92-
self._conn = client.connect(init_command=self.init_fun,
93-
sql_mode="NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,"
94-
"STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",
95-
**self.conn_info)
92+
with warnings.catch_warnings():
93+
warnings.filterwarnings('ignore', '.*deprecated.*')
94+
self._conn = client.connect(init_command=self.init_fun,
95+
sql_mode="NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,"
96+
"STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION",
97+
**self.conn_info)
9698

9799
def register(self, schema):
98100
self.schemas[schema.database] = schema

0 commit comments

Comments
 (0)