Pedro Machado
10/13/2020, 11:16 PMChris White
Pedro Machado
10/13/2020, 11:52 PMChris White
Pedro Machado
10/13/2020, 11:56 PMgmail_notifier
would I have to code from scratch or is there another place where I should be looking?Chris White
Pedro Machado
10/13/2020, 11:59 PMcase
to make the notification conditional instead of relying on the state handler. Correct?Chris White
case
for sure, but if it were me I’d probably do the following:
class CustomEmailTask(EmailTask):
def run(self, data, **kwargs):
# perform conditional check on data
if conditional_check:
return super().run(**kwargs)
else:
<http://self.logger.info|self.logger.info>("Conditional check did not pass, not sending email.")
raise prefect.engine.signals.SKIP("No need to send email.")
I prefer fewer tasks and more use of Prefect States / signals, but that’s just a personal preferencePedro Machado
10/14/2020, 12:06 AMChris White