Custom trigger does not executes python code

Andrej
Registered Posts: 2 ✭
Hi, I am quite new in Dataiku and I am interested why the following code does not work as expected. Namely, I am trying to define custom trigger that will check if the folder is empty.
Both
from dataiku.scenario import Trigger t=Trigger() folder = dataiku.Folder("folder_id") files = folder.list_paths_in_partition() if files: t.fire()
and
from dataiku.scenario import Trigger t=Trigger() client = dataiku.api_client() project = client.get_default_project() folder = project.get_managed_folder("project_id") files = f.list_contents()["items"] if files: t.fire()
do not fire the trigger. I cannot open the logs since I do not have appropriate permissions I guess.
Do you have any suggestions how to solve this?
Thank you!
Tagged:
Best Answer
-
Oh, forgot to import dataiku package :) Sorry