How to get the list of items of default zone using python?

Savan
Savan Dataiku DSS Core Concepts, Registered Posts: 5 ✭✭✭

This is my code and 'Data Pool' is my default zone and it has more hen 10 tables but it is not fetching the list of items for default zone. however it is working for other zones but not for this default zone.

Operating system used: Windows

Operating system used: Windows

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,063 Neuron

    I can't copy/paste the code to test it since you uploaded as an image. Please use the code block (the </> icon) and upload your code as text. Thanks

  • Savan
    Savan Dataiku DSS Core Concepts, Registered Posts: 5 ✭✭✭
    import dataiku
    from dataiku import pandasutils as pdu
    import pandas as pd
     
    client = dataiku.api_client()
    project = client.get_default_project()
    variables = dataiku.get_custom_variables()
    flow = project.get_flow()
    connection_string = variables["sf_connection"]
    db_serv = variables["DB_SERV"]
    schema_s = variables["Tenant_ID"]
    schema_i = variables["schema_i"]
    schema_c = variables["schema_c"]
    fs_connection_string = 'filesystem_managed'
     
    flow_zone = {}
    for flow_list in flow.list_zones():
        if flow_list.name in ('Data Pool'):
            flow_zone[flow_list.name] = flow_list.id
            zone1 = flow.get_zone(flow_list.id)
        zone_datasets = []
        for items in zone1.items:
            item_dict = items.__dict__
            zone_datasets.append(item_dict['dataset_name'])
    

Setup Info
    Tags
      Help me…