Skip to content

Commit

Permalink
Fixes date serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Sep 8, 2023
1 parent bd25146 commit 93e4461
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chowda/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ async def parse_obj(self, request: Request, obj: Any) -> Any:

return [run.dict() for run in new_runs or obj.metaflow_runs]

async def serialize_value(
self, request: Request, value: Any, action: RequestAction
) -> Any:
return [
{
**run,
'finished_at': run['finished_at'].isoformat()
if run.get('finished_at')
else None,
}
for run in value
]


@dataclass
class BatchPercentCompleted(BaseField):
Expand Down

0 comments on commit 93e4461

Please sign in to comment.