Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello,
I am currently parametrizing a scenario in which i try to launch a 'Build/Train Step' if a condition is satisfied. The condition i am trying to implement is based on the result of the previous Step which is a 'Custom Python Step'.
Until now, when i am launching my scenario, the condition is never verified and so the Build/Train Step never works.
Does someone now how to use the output of a Custom Python Step in my Build/Train Step ?
Thank you in advance.
Hi @Remi_Mathieu,
You may already be setting a scenario variable in your Execute Python step but just in case here is how to do that:
from dataiku.scenario import Scenario
Scenario().set_scenario_variables(pythonStepResult='OK')
This topic by @tomas describes how to set a step condition to check the value of a variable: https://community.dataiku.com/t5/Using-Dataiku-DSS/How-to-use-variables-in-the-Scenario-step-conditi...
Turns out to be very simple - just use the variable name directly: pythonStepResult == 'OK'
Marlan
You can use:
stepResults.getPath(".['customPythonStep1'].outcome").arrayContains("SUCCESS")
With FAILED, WARNING being the other 2 possible outcomes
Note that step output and step results are slightly different. Step outputs are only availables on steps which provide one (for ex: the execute SQL step puts the results of the SQL query. as output)
In fact, "OK" is the result of a function which is in the Custom Python Step. My purpose is getting the result of these function and not getting the state of the Step (SUCCESS, WARNING, FAILED)
Hi @Remi_Mathieu,
You may already be setting a scenario variable in your Execute Python step but just in case here is how to do that:
from dataiku.scenario import Scenario
Scenario().set_scenario_variables(pythonStepResult='OK')
This topic by @tomas describes how to set a step condition to check the value of a variable: https://community.dataiku.com/t5/Using-Dataiku-DSS/How-to-use-variables-in-the-Scenario-step-conditi...
Turns out to be very simple - just use the variable name directly: pythonStepResult == 'OK'
Marlan
Thanks you for your response. It works very well on my case.