When reducing create_student action the reducer will fail. The last two parts of the stacktrace are the following.
/home/jaroslav/bin/git/flocs-core/flocs/reducers.py in <dictcomp>(.0)
42 def adapted_reducer(entity_dict, data, context):
43 data_with_context = ChainMap(data, context)
---> 44 data_kwargs = {key: data_with_context[key] for key in data_keys}
45 return reducer(entity_dict, **data_kwargs)
46 return adapted_reducer
/usr/lib/python3.5/collections/__init__.py in __getitem__(self, key)
873 for mapping in self.maps:
874 try:
--> 875 return mapping[key] # can't use 'key in mapping' with defaultdict
876 except KeyError:
877 pass
TypeError: 'NoneType' object is not subscriptable
It seem like it tries to look up student's last_task_session that is unfortunately not present in the data_with_context.
Minimal reproducer I could find is the following.
import flocs
from flocs.store import Store
from flocs.entities import Student
import flocs.actions
with Store.open({Student: {}}) as store:
store.stage_action(actions.create_student())
When reducing create_student action the reducer will fail. The last two parts of the stacktrace are the following.
It seem like it tries to look up student's
last_task_session
that is unfortunately not present in thedata_with_context
.Minimal reproducer I could find is the following.