Custom scenario on variable change
lau_sch
Registered Posts: 7 ✭✭✭
Hello,
my trigger does not launch with this trigger even though variables VAR_A and VAR_B are set to 1 :
from dataiku.scenario import Trigger
import dataiku
PROJECT_ID = "RCU_V2"
client = dataiku.api_client()
project_handle = client.get_project(PROJECT_ID)
variables = project_handle.get_variables()
print(variables)
t = Trigger()
if variables['standard']['VAR_A'] == 1 & variables['standard']['VAR_B'] == 1:
t.fire()
Best Answer
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,161 Neuron
Please use code blocks (</> icon) when you post Python code as otherwise we can't easily copy/paste your code to test (as Python requires strict identation). You should replace your & by and:
if variables['standard']['VAR_A'] == 1 and variables['standard']['VAR_B'] == 1: t.fire()
https://www.geeksforgeeks.org/difference-between-and-and-in-python/
Answers
-
Thank you for your reply !