mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-03-22 07:06:47 +00:00
fix: pass DagStatusData model instead of dict to append_event_and_broadcast
add_event() calls .model_dump() on data, so it needs a Pydantic model not a dict.
This commit is contained in:
@@ -216,7 +216,7 @@ async def broadcast_dag_status(transcript_id: str, workflow_run_id: str) -> None
|
||||
transcript_id,
|
||||
transcript,
|
||||
"DAG_STATUS",
|
||||
dag_status.model_dump(mode="json"),
|
||||
dag_status,
|
||||
logger,
|
||||
)
|
||||
except Exception:
|
||||
|
||||
@@ -676,8 +676,9 @@ class TestBroadcastDagStatus:
|
||||
assert call_args[0][1] is mock_transcript # transcript
|
||||
assert call_args[0][2] == "DAG_STATUS" # event_name
|
||||
data = call_args[0][3]
|
||||
assert data["workflow_run_id"] == "wf-abc"
|
||||
assert len(data["tasks"]) == 1
|
||||
assert isinstance(data, DagStatusData)
|
||||
assert data.workflow_run_id == "wf-abc"
|
||||
assert len(data.tasks) == 1
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_swallows_exceptions(self):
|
||||
|
||||
Reference in New Issue
Block a user