Luigi

WrapperTask failures in requires() method do not trigger FAILURE events

warning
configurationUpdated Mar 24, 2026
Technologies:
How to detect:

When a WrapperTask fails within its requires() method, Luigi does not trigger the FAILURE event, preventing registered event handlers from executing. This affects cleanup operations and error logging that depend on FAILURE event handlers.

Recommended action:

Wrap the entire requires() method body with a context manager that catches exceptions and manually calls task.trigger_event(luigi.Event.FAILURE, task, exception) before re-raising. Apply this pattern to all WrapperTasks that need failure event handling. The workaround remains necessary in current stable Luigi versions.