Skip to content

Commit

Permalink
fix display issue
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-milea committed May 22, 2024
1 parent d345d84 commit 41f3835
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/syft/src/syft/service/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Any

# third party
from IPython.display import display
from result import Err

# relative
Expand All @@ -17,8 +18,22 @@ class SyftResponseMessage(SyftBaseModel):
require_api_update: bool = False

def __getattr__(self, name: str) -> Any:
if name == "_bool":
if name in [
"_bool",
# "_repr_html_",
# "message",
# 'require_api_update',
# '__bool__',
# '__eq__',
# '__repr__',
# '__str__',
# '_repr_html_class_',
# '_repr_html_',
"_ipython_canary_method_should_not_exist_",
"_ipython_display_",
] or name.startswith("_repr"):
return super().__getattr__(name)
display(self)
raise Exception(
f"You have tried accessing `{name}` on a {type(self).__name__} with message: {self.message}"
)
Expand Down

0 comments on commit 41f3835

Please sign in to comment.