Skip to content

Commit 0061dec

Browse files
authored
[FSTORE-1400] Make sure jobs endpoint always returns count value (#205)
* init * fix formatting
1 parent 7107ece commit 0061dec

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

python/hopsworks/job.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
# limitations under the License.
1515
#
1616

17-
import humps
1817
import json
19-
from hopsworks.engine import execution_engine
20-
from hopsworks.core import job_api, execution_api
21-
from hopsworks import util, job_schedule as js
22-
2318
from datetime import datetime, timezone
2419

20+
import humps
21+
from hopsworks import job_schedule as js
22+
from hopsworks import util
23+
from hopsworks.core import execution_api, job_api
24+
from hopsworks.engine import execution_engine
25+
2526

2627
class Job:
2728
def __init__(
@@ -64,7 +65,7 @@ def __init__(
6465

6566
@classmethod
6667
def from_response_json(cls, json_dict, project_id, project_name):
67-
if "count" in json_dict:
68+
if "items" in json_dict:
6869
jobs = []
6970
for job in json_dict["items"]:
7071
# Job config should not be decamelized when updated
@@ -79,7 +80,6 @@ def from_response_json(cls, json_dict, project_id, project_name):
7980
)
8081
)
8182
return jobs
82-
# TODO: fix backend to set count to 0 when no jobs exists
8383
elif "id" not in json_dict:
8484
return []
8585
else:

0 commit comments

Comments
 (0)