acoustic-carpenter-78188
03/31/2026, 7:20 AMflyte.map returns exceptions as values (return_exceptions=True), user code that performs arithmetic on them (e.g. sum(results)) would get a confusing TypeError: unsupported operand type(s) for +: 'int' and 'RetriesExhaustedError'
• Added numeric dunder methods (__add__, __radd__, __sub__, __mul__, __truediv__, __floordiv__ and reverses) to BaseRuntimeError that re-raise the original subtask error instead
Before:
Screenshot 2026-03-31 at 12 21 27 AM
After:
Screenshot 2026-03-31 at 12 21 15 AM
Test plan
• Unit tests for all arithmetic dunder methods on BaseRuntimeError
• Integration test: flyte.map with failing subtasks → sum(results) now surfaces the subtask error
• Existing test_mapping.py and test_map_concurrency.py tests pass (19 total)
flyteorg/flyte-sdkacoustic-carpenter-78188
03/31/2026, 10:32 PM