Skip to content

Commit

Permalink
pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
KaylaSeeley committed Nov 21, 2024
1 parent ecd5cd8 commit f8def01
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions metaflow/plugins/events_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,16 @@ def flow_init(
# TODO: Handle scenario for local testing using --trigger.

def format_deploytime_value(self):
new_triggers = self.triggers
new_triggers = []
for trigger in self.triggers:
# Case where trigger is a function that returns a list of events
# Need to do this bc we need to iterate over list later
if isinstance(trigger, DeployTimeField):
evaluated_trigger = deploy_time_eval(trigger)
old_trig = trigger
if isinstance(evaluated_trigger, dict):
trigger = evaluated_trigger
elif isinstance(evaluated_trigger, str):
trigger = {"name": evaluated_trigger}
new_triggers.remove(old_trig)
if isinstance(evaluated_trigger, list):
for trig in evaluated_trigger:
if is_stringish(trig):
Expand All @@ -227,6 +225,8 @@ def format_deploytime_value(self):
new_triggers.append(trig)
else:
new_triggers.append(trigger)
else:
new_triggers.append(trigger)

self.triggers = new_triggers
for trigger in self.triggers:
Expand Down Expand Up @@ -303,6 +303,7 @@ def format_deploytime_value(self):
new_trigger_params[key] = value
trigger["parameters"] = new_trigger_params
self.triggers[self.triggers.index(old_trigger)] = trigger
print(self.triggers)


class TriggerOnFinishDecorator(FlowDecorator):
Expand Down

0 comments on commit f8def01

Please sign in to comment.