Dataset custom fields and metadata

Chiktika
Chiktika Registered Posts: 24 ✭✭✭✭

Hi,

I would like to add custom data on datasets.

Custom fields component seems to be the thing I need, they're appear on dataset summary page so it's easy to configure them, but I didn't find a way to read them in python recipes via dataiku API. I thought I can read them with the read_metadata() or get_metadata() methods but it's not the case

In another way, I tried to use custom metadata. I configure them via dataiku API, but I don't fin where they appear on dataset summary page.

- is it possible to read custom fields via DSS python API?

- are supposed custom metadata to be displayed on dataset summary page?

With many thanks for your help.

Regards.

C.

Tagged:

Best Answer

  • HarizoR
    HarizoR Dataiker, Alpha Tester, Registered Posts: 138 Dataiker
    edited July 17 Answer ✓

    Hi,

    You can programmatically retrieve the custom fields of a dataset using the DSS Dataset API, for example in your recipe you would have something like this:

    import dataiku
    client = dataiku.api_client()
    project = client.get_project(dataiku.get_custom_variables()["projectKey"])
    # Get a dataset handle for the public API, not a dataiku.Dataset object
    dataset = project.get_dataset("YOUR_DATASET")
    dataset_settings = dataset.get_settings()
    custom_fields = dataset_settings.get_raw()["customFields"]

    Best,

    Harizo

Answers

Setup Info
    Tags
      Help me…