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

Fix request repr #8811

Merged
merged 4 commits into from
May 21, 2024
Merged
Changes from 2 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
20 changes: 11 additions & 9 deletions packages/syft/src/syft/service/request/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ def _coll_repr_(self) -> dict[str, str | dict[str, str]]:
"Request time": str(self.request_time),
"Description": self.html_description,
"Requested By": "\n".join(user_data),
"Creation Time": str(self.request_time),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of line 470

"Status": status_badge,
}

Expand Down Expand Up @@ -1220,18 +1221,19 @@ def nested_repr(self, node: Any | None = None, level: int = 0) -> str:

def __repr_syft_nested__(self) -> str:
msg = (
f"Request to change <b>{self.code.service_func_name}</b> "
f"(Pool Id: <b>{self.code.worker_pool_name}</b>) "
f"Request to change <strong>{self.code.service_func_name}</strong> "
f"(Pool Id: <strong>{self.code.worker_pool_name}</strong>) "
)
msg += "to permission <strong>RequestStatus.APPROVED.</strong>"
if self.nested_solved:
if self.link.nested_codes == {}: # type: ignore
msg += "No nested requests."
else:
msg += "to permission RequestStatus.APPROVED."
if self.code.nested_codes is None or self.code.nested_codes == {}: # type: ignore
msg += " No nested requests"
else:
if self.nested_solved:
# else:
msg += "<br><br>This change requests the following nested functions calls:<br>"
msg += self.nested_repr()
else:
msg += "Nested Requests not resolved."
else:
msg += " Nested Requests not resolved"
return msg

def _repr_markdown_(self, wrap_as_python: bool = True, indent: int = 0) -> str:
Expand Down
Loading