Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion backend/app/api/v1/commons/oso.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import pandas as pd

from app.api.v1.commons.constants import OSO_FIELD_CONSTANT_DICT
from app.api.v1.commons.constants import (
JOB_STATUS_MAP,
JOB_STATUS_OTHERS,
OSO_FIELD_CONSTANT_DICT,
)
import app.api.v1.commons.utils as utils
from app.services.search import ElasticService

Expand Down Expand Up @@ -51,6 +55,13 @@ async def getData(
if len(jobs) == 0:
return {"data": jobs, "total": response["total"]}

jobs["jobStatus"] = jobs["jobStatus"].apply(
lambda v: (
JOB_STATUS_MAP.get(str(v).lower(), JOB_STATUS_OTHERS)
if pd.notna(v) and str(v).strip()
else JOB_STATUS_OTHERS
)
)
return {"data": jobs, "total": response["total"]}


Expand Down
1 change: 1 addition & 0 deletions backend/tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
script this from outside the pod; so we run this little Python program
inside the Opensearch container.
"""

import os
import time

Expand Down
Loading