Shared datasets in Flow Zone
PoojaJogdand
Registered Posts: 1 ✭✭✭
How to find shared dataset list from number of flow zone? the dataset present in default zone but used in other created zone.
Answers
-
Keiji Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 52 Dataiker
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