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!
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
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.
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.