Skip to content

Commit 5e1a967

Browse files
committed
quick guidemsg bugfix
1 parent bb74ca2 commit 5e1a967

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

zephyr_ml/core.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,18 @@ def try_log_backwards_set_method_warning(self, name, next_step):
125125
f"\tAll other steps will be considered stale."))
126126

127127
def try_log_backwards_key_method_warning(self, name, next_step):
128-
steps_in_between = self.join_steps(
129-
self.get_steps_in_between(
130-
self.current_step, next_step))
128+
steps_in_between = self.get_steps_in_between(next_step, self.current_step)
129+
if steps_in_between > 0:
130+
steps_in_between_str = (f"\tThe following steps will be considered stale:\n"
131+
f"{self.join_steps(steps_in_between)}")
132+
else:
133+
steps_in_between_str = ""
134+
131135
LOGGER.warning((f"[GUIDE] STALE WARNING:\n"
132136
f"\tGoing from step {self.current_step} to "
133137
f"step {next_step} by performing {name}.\n"
134138
f"\tThis is a backwards step via a key method.\n"
135-
f"\tThe following steps will be considered stale:\n"
136-
f"{steps_in_between}"))
139+
f"{steps_in_between_str}"))
137140

138141
def log_get_inconsistent_warning(self, name, next_step):
139142
prod_steps_str = self.or_join(self.ordered_steps[next_step][0])

0 commit comments

Comments
 (0)