From c2c310901f37fa68ff39f2ae8218690905369a38 Mon Sep 17 00:00:00 2001 From: Richard Franklin Date: Wed, 11 Sep 2024 12:26:22 -0700 Subject: [PATCH] on_item call on item (not item[*]) --- graphbook/steps/base.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/graphbook/steps/base.py b/graphbook/steps/base.py index efe2a0b..fb037dc 100644 --- a/graphbook/steps/base.py +++ b/graphbook/steps/base.py @@ -123,12 +123,11 @@ def __call__(self, note: Note) -> StepOutput: self.on_before_items(note) if self.item_key is not None: - items = note.items.get(self.item_key, None) + item = note.items.get(self.item_key, None) assert ( - items is not None + item is not None ), f"Item key {self.item_key} not found in Note. Cannot retrieve any iterable." - for item in items: - self.on_item(item, note) + self.on_item(item, note) self.on_after_items(note)