mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2026-04-24 06:05:19 +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_id,
|
||||||
transcript,
|
transcript,
|
||||||
"DAG_STATUS",
|
"DAG_STATUS",
|
||||||
dag_status.model_dump(mode="json"),
|
dag_status,
|
||||||
logger,
|
logger,
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@@ -676,8 +676,9 @@ class TestBroadcastDagStatus:
|
|||||||
assert call_args[0][1] is mock_transcript # transcript
|
assert call_args[0][1] is mock_transcript # transcript
|
||||||
assert call_args[0][2] == "DAG_STATUS" # event_name
|
assert call_args[0][2] == "DAG_STATUS" # event_name
|
||||||
data = call_args[0][3]
|
data = call_args[0][3]
|
||||||
assert data["workflow_run_id"] == "wf-abc"
|
assert isinstance(data, DagStatusData)
|
||||||
assert len(data["tasks"]) == 1
|
assert data.workflow_run_id == "wf-abc"
|
||||||
|
assert len(data.tasks) == 1
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_swallows_exceptions(self):
|
async def test_swallows_exceptions(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user