Compare project

thomaslprru
thomaslprru Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 10

Hi,

I just want to know if there is an efficient way to compare two projects ?

I want to duplicate a project only if this project isn't yet duplicated, is there a method to do this easily or I have to create my own method and compare different informations like project size, dataset name, etc.

Thanks in advance,

Respectfully,

Thomas


Operating system used: Windows

Tagged:

Best Answer

  • Zach
    Zach Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 153 Dataiker
    edited July 17 Answer ✓

    Hi @thomaslprru
    ,

    You can check the project's timeline to determine if it was duplicated from another project.

    If the project was duplicated, the first item in the timeline will be a PROJECT_DUPLICATE action.

    The following code will get the first item in a project's timeline:

    import dataiku
    
    client = dataiku.api_client()
    
    project = client.get_project("COPYOFPROJECT")
    # You might need to increase item_count if your project has a lot of changes
    timeline = project.get_timeline(item_count=100)
    
    first_action = timeline["items"][-1]
    print(first_action)

    Example output:

    {
        "user": "admin",
        "action": "PROJECT_DUPLICATE",
        "projectKey": "COPYOFMYPROJECT",
        "objectType": "PROJECT",
        "objectId": "MYPROJECT",
        "details": {
            "objectDisplayName": "Copy of my-project",
            "userDisplayName": "Administrator",
        },
        "time": 1671495995119
    }

    Thanks,

    Zach

Setup Info
    Tags
      Help me…