(self, value: Any, keys: tuple[str, ...])
| 1870 | } |
| 1871 | |
| 1872 | def _find_nested_string(self, value: Any, keys: tuple[str, ...]) -> Optional[str]: |
| 1873 | if isinstance(value, dict): |
| 1874 | for key in keys: |
| 1875 | candidate = value.get(key) |
| 1876 | if isinstance(candidate, str) and candidate.strip(): |
| 1877 | return candidate.strip() |
| 1878 | for candidate in value.values(): |
| 1879 | found = self._find_nested_string(candidate, keys) |
| 1880 | if found: |
| 1881 | return found |
| 1882 | elif isinstance(value, list): |
| 1883 | for item in value: |
| 1884 | found = self._find_nested_string(item, keys) |
| 1885 | if found: |
| 1886 | return found |
| 1887 | return None |
| 1888 | |
| 1889 | def _truncate_large_debug_value(self, data: Any, max_length: int = 240) -> Any: |
| 1890 | """截断调试输出中的超长字段,避免污染控制台。""" |
no outgoing calls
no test coverage detected