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!
How to find shared dataset list from number of flow zone? the dataset present in default zone but used in other created zone.
Hello @PoojaJogdand,
With the Dataiku Python API, you can use the DSSFlowZone.shared property to get a list of items which are shared to a zone.
Here is sample code to list datasets which are shared to a zone:
from collections import defaultdict
import dataiku
from dataikuapi.dss.dataset import DSSDataset
client = dataiku.api_client()
project = client.get_project(dataiku.default_project_key())
flow = project.get_flow()
shared_datasets = defaultdict(set)
for zone in flow.list_zones():
for item in zone.shared:
if type(item) is DSSDataset:
shared_datasets[item.id].add(zone.name)
for shared_dataset in shared_datasets.items():
print(shared_dataset)
I hope this would help.
Sincerely,
Keiji