File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import random
66import inspect
77from tqdm import tqdm
8- from pymysql import OperationalError
98from .expression import QueryExpression , AndList , U
10- from .errors import DataJointError
9+ from .errors import DataJointError , LostConnectionError
1110from .table import FreeTable
1211import signal
1312
@@ -161,7 +160,7 @@ def handler(signum, frame):
161160 except (KeyboardInterrupt , SystemExit , Exception ) as error :
162161 try :
163162 self .connection .cancel_transaction ()
164- except OperationalError :
163+ except LostConnectionError :
165164 pass
166165 error_message = '{exception}{msg}' .format (
167166 exception = error .__class__ .__name__ ,
Original file line number Diff line number Diff line change @@ -127,18 +127,18 @@ def parents(self, primary=None):
127127
128128 def children (self , primary = None ):
129129 """
130- :param primary: if None, then all parents are returned. If True, then only foreign keys composed of
130+ :param primary: if None, then all children are returned. If True, then only foreign keys composed of
131131 primary key attributes are considered. If False, the only foreign keys including at least one non-primary
132132 attribute are considered.
133133 :return: dict of tables with foreign keys referencing self
134134 """
135135 return self .connection .dependencies .children (self .full_table_name , primary )
136136
137137 def descendants (self ):
138- return self . connection .dependencies .descendants (self .full_table_name )
138+ return self .connection .dependencies .descendants (self .full_table_name )
139139
140140 def ancestors (self ):
141- return self . connection .dependencies .ancestors (self .full_table_name )
141+ return self .connection .dependencies .ancestors (self .full_table_name )
142142
143143 @property
144144 def is_declared (self ):
You can’t perform that action at this time.
0 commit comments