File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 5
5
import random
6
6
import inspect
7
7
from tqdm import tqdm
8
- from pymysql import OperationalError
9
8
from .expression import QueryExpression , AndList , U
10
- from .errors import DataJointError
9
+ from .errors import DataJointError , LostConnectionError
11
10
from .table import FreeTable
12
11
import signal
13
12
@@ -161,7 +160,7 @@ def handler(signum, frame):
161
160
except (KeyboardInterrupt , SystemExit , Exception ) as error :
162
161
try :
163
162
self .connection .cancel_transaction ()
164
- except OperationalError :
163
+ except LostConnectionError :
165
164
pass
166
165
error_message = '{exception}{msg}' .format (
167
166
exception = error .__class__ .__name__ ,
Original file line number Diff line number Diff line change @@ -127,18 +127,18 @@ def parents(self, primary=None):
127
127
128
128
def children (self , primary = None ):
129
129
"""
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
131
131
primary key attributes are considered. If False, the only foreign keys including at least one non-primary
132
132
attribute are considered.
133
133
:return: dict of tables with foreign keys referencing self
134
134
"""
135
135
return self .connection .dependencies .children (self .full_table_name , primary )
136
136
137
137
def descendants (self ):
138
- return self . connection .dependencies .descendants (self .full_table_name )
138
+ return self .connection .dependencies .descendants (self .full_table_name )
139
139
140
140
def ancestors (self ):
141
- return self . connection .dependencies .ancestors (self .full_table_name )
141
+ return self .connection .dependencies .ancestors (self .full_table_name )
142
142
143
143
@property
144
144
def is_declared (self ):
You can’t perform that action at this time.
0 commit comments