From dataiku API how to access to SQL Probe code

Options
oscieux
oscieux Registered Posts: 3 ✭✭✭

Hi all,

My question is in the subject

Do anyone have a solution please?

Tagged:

Best Answer

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    edited July 17 Answer ✓
    Options

    Hi @oscieux
    ,

    You can use the get_dataset() get_settings() get_raw() to retrieve SQL Probe code:

    import dataiku
    import pprint
    pp = pprint.PrettyPrinter(indent=4)
    client = dataiku.api_client()
    project = client.get_default_project()
    
    dataset = project.get_dataset("IMPORT_FROM_V5_sql_bad")
    settings = dataset.get_settings()
    params = settings.get_raw()['metrics']['probes']
    for i in params:
        if i['type'] == 'sql_query':
            pp.pprint(i['configuration']['code'])

    Screenshot 2022-03-24 at 10.32.58.png

    Let me know if that's what you were looking for!

Answers

Setup Info
    Tags
      Help me…