You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both do the same thing, but as the naming suggests, the latter also provides a master record.
337
343
The [`register_correlation_hook`][dp3.common.callback_registrar.CallbackRegistrar.register_correlation_hook]
338
344
method expects a callable with the following signature:
339
345
`Callable[[str, dict], Union[None, list[DataPointTask]]]`, where the first argument is the entity type, and the second is a dict
340
346
containing the current values of the entity and its linked entities.
341
-
The method can optionally return a list of DataPointTask objects to be inserted into the system.
347
+
The [`register_correlation_hook_with_master_record`][dp3.common.callback_registrar.CallbackRegistrar.register_correlation_hook_with_master_record] method expects a callable with the following signature:
348
+
`Callable[[str, dict, dict], Union[None, list[DataPointTask]]]` - the first two arguments are identical (entity type and dict with current values), but there is also a third argument: a dictionary of values stored in the master record of the entity.
349
+
The method (applicable to both variants) can optionally return a list of `DataPointTask` objects to be inserted into the system.
342
350
343
351
As correlation hooks can depend on each other, the hook inputs and outputs must be specified
344
-
using the depends_on and may_change arguments. Both arguments are lists of lists of strings,
352
+
using the `depends_on` and `may_change` arguments. Both arguments are lists of lists of strings,
345
353
where each list of strings is a path from the specified entity type to individual attributes (even on linked entities).
346
354
For example, if the entity type is `test_entity_type`, and the hook depends on the attribute `test_attr_type1`,
347
355
the path is simply `[["test_attr_type1"]]`. If the hook depends on the attribute `test_attr_type1`
@@ -351,9 +359,21 @@ of an entity linked using `test_attr_link`, the path will be `[["test_attr_link
0 commit comments