get datasets list in a flowzone using api
pritam003
Registered Posts: 8 ✭✭✭✭
Hi Team
Is there way to get the datasets name in a flow zone using API
for item in zone.items:
print(item)
this prints the zone items but not there name
Thanks
pritam
Best Answer
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,227 Dataiker
Hi,
That's because the datasets are returned as objects. If you use something like print("Zone item: %s" % item.__dict__) it will also print the dataset_name:
import dataiku import dataikuapi import pandas as pd, numpy as np client = dataiku.api_client() project_key = 'REPLACE_PROJECT_KEY' project = client.get_project(project_key) # List zones flow = project.get_flow() for zone in flow.list_zones(): print("Zone id=%s name=%s" % (zone.id, zone.name)) print("Zone has the following items:") for item in zone.items: print("Zone item: %s" % item.__dict__)
Let me know if that works for you.
Answers
-
Can I get all the datasets in a list?