@@ -105,8 +105,8 @@ def make(self, key):
105
105
The method can be implemented either as:
106
106
(a) Regular method: All three steps are performed in a single database transaction.
107
107
The method must return None.
108
- (b) Generator method:
109
- The make method is split into three functions:
108
+ (b) Generator method:
109
+ The make method is split into three functions:
110
110
- `make_fetch`: Fetches data from the parent tables.
111
111
- `make_compute`: Computes secondary attributes based on the fetched data.
112
112
- `make_insert`: Inserts the computed data into the current table.
@@ -124,7 +124,7 @@ def make(self, key):
124
124
self.make_insert(key, *computed_result)
125
125
commit_transaction
126
126
<pseudocode>
127
-
127
+
128
128
Importantly, the output of make_fetch is a tuple that serves as the input into `make_compute`.
129
129
The output of `make_compute` is a tuple that serves as the input into `make_insert`.
130
130
@@ -412,11 +412,10 @@ def _populate1(
412
412
!= deepdiff .DeepHash (fetched_data , ignore_iterable_order = False )[
413
413
fetched_data
414
414
]
415
- ): # rollback due to referential integrity fail
416
- self .connection .cancel_transaction ()
417
- logger .warning (
418
- f"Referential integrity failed for { key } -> { self .target .full_table_name } " )
419
- return False
415
+ ): # raise error if fetched data has changed
416
+ raise DataJointError (
417
+ "Referential integrity failed! The `make_fetch` data has changed"
418
+ )
420
419
gen .send (computed_result ) # insert
421
420
422
421
except (KeyboardInterrupt , SystemExit , Exception ) as error :
0 commit comments