Discover this year's submissions to the Dataiku Frontrunner Awards and give kudos to your favorite use cases and success stories!READ MORE

Is there a way to check in a Python recipe if it was called by a scenario?

Solved!
info-rchitect
Level 5
Is there a way to check in a Python recipe if it was called by a scenario?

Hi,

 

I have a scenario that triggers a Python recipe if a dependent dataset has changed.  I would like to be able to call some method to handle the logic in my recipe:

if triggerd_by_scenario:
    print('triggerd by a scenario')

thx


Operating system used: Windows 10

0 Kudos
1 Solution
NN
Neuron
Neuron

Hi @info-rchitect 
PLease check if something like below works

if 'scenarioTriggerRunId' in dataiku.get_custom_variables():
    print('Run by Scenario')

View solution in original post

1 Reply
NN
Neuron
Neuron

Hi @info-rchitect 
PLease check if something like below works

if 'scenarioTriggerRunId' in dataiku.get_custom_variables():
    print('Run by Scenario')

Labels

?
Labels (2)

Setup info

?
A banner prompting to get Dataiku