Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSTORE-1400] Make sure jobs endpoint always returns count value #205

Merged
merged 2 commits into from
May 30, 2024
Merged
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
14 changes: 7 additions & 7 deletions python/hopsworks/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
# limitations under the License.
#

import humps
import json
from hopsworks.engine import execution_engine
from hopsworks.core import job_api, execution_api
from hopsworks import util, job_schedule as js

from datetime import datetime, timezone

import humps
from hopsworks import job_schedule as js
from hopsworks import util
from hopsworks.core import execution_api, job_api
from hopsworks.engine import execution_engine


class Job:
def __init__(
Expand Down Expand Up @@ -64,7 +65,7 @@ def __init__(

@classmethod
def from_response_json(cls, json_dict, project_id, project_name):
if "count" in json_dict:
if "items" in json_dict:
jobs = []
for job in json_dict["items"]:
# Job config should not be decamelized when updated
Expand All @@ -79,7 +80,6 @@ def from_response_json(cls, json_dict, project_id, project_name):
)
)
return jobs
# TODO: fix backend to set count to 0 when no jobs exists
elif "id" not in json_dict:
return []
else:
Expand Down