Skip to content

Commit

Permalink
fix: casting when receiving FunctionProfilingStep (#932)
Browse files Browse the repository at this point in the history
* fix: casting when receiving `FunctionProfilingStep`

Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>

* docs: add change fragment

Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>

---------

Signed-off-by: Guilhem Barthés <guilhem.barthes@owkin.com>
  • Loading branch information
guilhem-barthes committed Jun 14, 2024
1 parent 682c4aa commit f00affe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/api/events/sync.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
import secrets
import string
from typing import Optional
Expand Down Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions changes/932.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
casting when receiving `FunctionProfilingStep` from the orchestrator

0 comments on commit f00affe

Please sign in to comment.