Identifying the Node Type in a DSS Notebook using Python

lau_sch
lau_sch Registered Posts: 7 ✭✭✭

In Python, in a DSS notebook, I want to know if the code is running in the design node or the automation node. How can I do that?

Best Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023, Circle Member Posts: 2,722 Neuron
    Answer ✓

    You can use this:

    import dataiku
    client = dataiku.api_client()
    client.get_instance_info().node_type
    

    Will return either

    DESIGN
    

    or

    AUTOMATION
    

    You could also do this with an instance level global variable the administrator can set.

  • lau_sch
    lau_sch Registered Posts: 7 ✭✭✭
    edited October 2024 Answer ✓

    Thank you it works !

Setup Info
    Tags
      Help me…