Skip to content

Commit 1cc80f8

Browse files
committed
Revert "Move rebuild jobs index"
This reverts commit 2dd7cb8.
1 parent 2dd7cb8 commit 1cc80f8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "transformerlab"
7-
version = "0.0.32"
7+
version = "0.0.31"
88
description = "Python SDK for Transformer Lab"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/lab/experiment.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ def create_job(self):
116116
new_job = Job.create(new_job_id)
117117
new_job.set_experiment(self.id)
118118

119-
# Update jobs index now that a new job exists
120-
self.rebuild_jobs_index()
121-
122119
return new_job
123120

124121
def get_jobs(self, type: str = "", status: str = ""):
@@ -127,6 +124,11 @@ def get_jobs(self, type: str = "", status: str = ""):
127124
type: If not blank, filter by jobs with this type.
128125
status: If not blank, filter by jobs with this status.
129126
"""
127+
128+
# Rebuild the index
129+
# TODO: The point of the index is to not do this every time
130+
self.rebuild_jobs_index()
131+
130132
# First get jobs of the passed type
131133
job_list = []
132134
if type:
@@ -143,6 +145,7 @@ def get_jobs(self, type: str = "", status: str = ""):
143145
job_json = job.get_json_data()
144146
except Exception:
145147
continue
148+
146149
# Filter for status
147150
if status and (job_json.get("status", "") != status):
148151
continue
@@ -154,7 +157,7 @@ def get_jobs(self, type: str = "", status: str = ""):
154157
# If it passed filters then add as long as it has job_data
155158
if "job_data" in job_json:
156159
results.append(job_json)
157-
160+
158161
return results
159162

160163
###############################

0 commit comments

Comments
 (0)