Skip to content

Commit 8cb149e

Browse files
committed
Address review: failed_task returns the latest failed task, say so
1 parent 665ca0f commit 8cb149e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎metaflow/client/core.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,13 +2409,13 @@ def successful(self) -> bool:
24092409
@property
24102410
def failed_task(self) -> Optional[Task]:
24112411
"""
2412-
Returns the first failed (unsuccessful) task in this run, if any.
2412+
Returns the latest failed (unsuccessful) task in this run, if any.
24132413
24142414
Steps and their tasks are scanned in iteration order, which is
2415-
newest-created first (see `MetaflowObject.__iter__`). The first task
2416-
whose `successful` is False is returned; for a failed run this is
2417-
typically the task that caused the failure. Returns None when every
2418-
task in the run is successful.
2415+
newest-created first (see `MetaflowObject.__iter__`), so the first
2416+
match is the latest failed task; for a failed run this is typically
2417+
the task that caused the failure. Returns None when every task in
2418+
the run is successful.
24192419
24202420
Together with `Flow.failed_runs` and `Task.failure_summary` this lets
24212421
you investigate failures through the regular client:
@@ -2431,7 +2431,7 @@ def failed_task(self) -> Optional[Task]:
24312431
Returns
24322432
-------
24332433
Task, optional
2434-
The first unsuccessful task, or None if the run has none.
2434+
The latest unsuccessful task, or None if the run has none.
24352435
"""
24362436
for step in self:
24372437
for task in step:

0 commit comments

Comments
 (0)