Skip to content

Commit

Permalink
Fix ReifyMetadata (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtopper authored Jan 22, 2024
1 parent 28344e0 commit d5270f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion storey/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def __init__(self, mapping: Iterable[str], **kwargs):
async def _do(self, event):
if event is not _termination_obj:
if isinstance(self.mapping, dict):
for attribute_name, entry_key in self.mapping:
for attribute_name, entry_key in self.mapping.items():
event.body[entry_key] = getattr(event, attribute_name)
else:
for attribute_name in self.mapping:
Expand Down
4 changes: 1 addition & 3 deletions tests/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3860,7 +3860,7 @@ def test_csv_source_event_metadata():
timestamp_format="%d/%m/%Y %H:%M:%S",
id_field="k",
),
ReifyMetadata({"key", "id"}),
ReifyMetadata({"key": "id"}),
Reduce([], append_and_return, full_event=False),
]
).run()
Expand All @@ -3872,15 +3872,13 @@ def test_csv_source_event_metadata():
"b": True,
"id": "m1",
"k": "m1",
"key": "m1",
"t": datetime(2020, 2, 15, 2, 0),
"v": 8,
},
{
"b": False,
"id": "m2",
"k": "m2",
"key": "m2",
"t": datetime(2020, 2, 16, 2, 0),
"v": 14,
},
Expand Down

0 comments on commit d5270f3

Please sign in to comment.