diff --git a/backend/api/events/sync.py b/backend/api/events/sync.py index fd96a9b15..755d7579c 100644 --- a/backend/api/events/sync.py +++ b/backend/api/events/sync.py @@ -1,3 +1,4 @@ +import datetime import secrets import string from typing import Optional @@ -434,8 +435,9 @@ def _create_failure_report(data: dict) -> None: def _on_create_profiling_step_event(data: dict) -> None: + duration = datetime.timedelta(seconds=data["profiling_step"]["duration"]) profiling_step = FunctionProfilingStep( - function_key=data["asset_key"], duration=data["profiling_step"]["duration"], step=data["profiling_step"]["step"] + function_id=data["asset_key"], duration=duration, step=data["profiling_step"]["step"] ) profiling_step.save() diff --git a/changes/932.fixed b/changes/932.fixed new file mode 100644 index 000000000..6d99ca0e6 --- /dev/null +++ b/changes/932.fixed @@ -0,0 +1 @@ +casting when receiving `FunctionProfilingStep` from the orchestrator