From 007d12a365a6266836078225c7daf67b137d65b3 Mon Sep 17 00:00:00 2001 From: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com> Date: Thu, 20 Nov 2025 21:16:14 +0800 Subject: [PATCH] [Polish] Simplify __repr__ method in Request class Remove detailed string representation for Request class. --- fastdeploy/engine/request.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/fastdeploy/engine/request.py b/fastdeploy/engine/request.py index f71eca7dbb3..569cb149fd3 100644 --- a/fastdeploy/engine/request.py +++ b/fastdeploy/engine/request.py @@ -310,19 +310,7 @@ def set(self, key, value): def __repr__(self) -> str: """Safe string representation that ignores private and None fields.""" - try: - if not envs.FD_DEBUG: - return f"Request(request_id={self.request_id})" - else: - attrs_snapshot = dict(vars(self)) - non_none_fields = [ - f"{attr}={value!r}" - for attr, value in attrs_snapshot.items() - if value is not None and not attr.startswith("_") - ] - return f"Request({', '.join(non_none_fields)})" - except Exception as e: - return f"<{self.__class__.__name__} repr failed: {e}>" + return "" @dataclass(slots=True)