Skip to content

Commit

Permalink
[FSTORE-1400] Make sure jobs endpoint always returns count value (#205)
Browse files Browse the repository at this point in the history
* init

* fix formatting
  • Loading branch information
bubriks authored May 30, 2024
1 parent 7107ece commit 0061dec
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 0061dec

Please sign in to comment.