joeyutong commented on code in PR #924:
URL: https://github.com/apache/flink-agents/pull/924#discussion_r3702355667
##########
python/flink_agents/runtime/flink_runner_context.py:
##########
@@ -56,6 +59,24 @@
logger = logging.getLogger(__name__)
+def _error_type(error: BaseException) -> str:
+ return f"{error.__class__.__module__}.{error.__class__.__qualname__}"
+
+
+def _root_cause(error: BaseException) -> BaseException:
+ current = error
+ visited: set[int] = set()
+ while id(current) not in visited:
+ visited.add(id(current))
+ cause = current.__cause__
+ if cause is None and not current.__suppress_context__:
+ cause = current.__context__
Review Comment:
Good catch. The previous test covered only explicit `__cause__`, so the
Python-only implicit `__context__` branch remained unaligned. I removed that
fallback: Python now follows only explicitly chained causes, matching Java
`Throwable.getCause()`, and added a regression test confirming implicit context
is not used.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]