@@ -77,6 +77,7 @@ def __init__(self, log: logging.Logger, model_spec: ModelSpec, elog: EventGroupT
77
77
self .model_spec = model_spec
78
78
79
79
self ._hooks : defaultdict [str , list [tuple [str , Callable ]]] = defaultdict (list )
80
+ self ._short_hook_ids : dict = {}
80
81
81
82
self ._dependency_graph = DependencyGraph (self .log )
82
83
self .used_links = set ()
@@ -118,11 +119,9 @@ def register(
118
119
depends_on = self ._get_attr_path_destinations (entity_type , depends_on )
119
120
may_change = self ._get_attr_path_destinations (entity_type , may_change )
120
121
121
- hook_id = (
122
- f"{ get_func_name (hook )} ("
123
- f"{ entity_type } , [{ ',' .join (depends_on )} ], [{ ',' .join (may_change )} ]"
124
- f")"
125
- )
122
+ hook_args = f"({ entity_type } , [{ ',' .join (depends_on )} ], [{ ',' .join (may_change )} ])"
123
+ hook_id = f"{ get_func_name (hook )} { hook_args } "
124
+ self ._short_hook_ids [hook_id ] = hook_args
126
125
self ._dependency_graph .add_hook_dependency (hook_id , depends_on , may_change )
127
126
128
127
self ._hooks [entity_type ].append ((hook_id , hook ))
@@ -208,8 +207,9 @@ def run(self, entities: dict) -> list[DataPointTask]:
208
207
209
208
with task_context (self .model_spec ):
210
209
for hook_id , hook , etype in hook_subset :
210
+ short_id = hook_id if len (hook_id ) < 160 else self ._short_hook_ids [hook_id ]
211
211
for eid , entity_values in entities_by_etype [etype ].items ():
212
- self .log .debug ("Running hook %s on entity %s" , hook_id , eid )
212
+ self .log .debug ("Running hook %s on entity %s" , short_id , eid )
213
213
try :
214
214
tasks = hook (etype , entity_values )
215
215
if tasks is not None and tasks :
0 commit comments