Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/syft-enclave/src/syft_enclaves/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def jobs(self) -> JobsList:
else j
for j in jobs_list
]
return JobsList(wrapped, jobs_list._root_email)
return jobs_list.copy_with(wrapped)

def submit_python_job(
self,
Expand Down
1 change: 0 additions & 1 deletion packages/syft-job/src/syft_job/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ def job_sort_key(job):
sorted_jobs = sorted(current_jobs, key=job_sort_key)
return JobsList(
sorted_jobs,
self.target_datasite_owner_email,
has_do_role=self.has_do_role,
)

Expand Down
11 changes: 7 additions & 4 deletions packages/syft-job/src/syft_job/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,14 @@ def _repr_html_(self) -> str:
class JobsList:
"""A list-like container for JobInfo objects with nice display."""

def __init__(self, jobs: List[JobInfo], root_email: str, has_do_role: bool = False):
def __init__(self, jobs: List[JobInfo], has_do_role: bool = False):
self._jobs = jobs
self._root_email = root_email
self._has_do_role = has_do_role

def copy_with(self, jobs: List[JobInfo]) -> "JobsList":
"""Return a new list with the same display options but different jobs."""
return JobsList(jobs, has_do_role=self._has_do_role)

def __getitem__(self, index: int | str) -> JobInfo:
if isinstance(index, int):
return self._jobs[index]
Expand All @@ -449,10 +452,10 @@ def __iter__(self):
return iter(self._jobs)

def __str__(self) -> str:
return jobs_list_str(self._jobs, self._root_email, self._has_do_role)
return jobs_list_str(self._jobs, has_do_role=self._has_do_role)

def __repr__(self) -> str:
return f"JobsList({len(self._jobs)} jobs)"

def _repr_html_(self) -> str:
return jobs_list_repr_html(self._jobs, self._root_email, self._has_do_role)
return jobs_list_repr_html(self._jobs, has_do_role=self._has_do_role)
Loading
Loading