API to check managed SQL dataset schema consistency

WH
WH Registered Posts: 17 ✭✭✭✭
edited July 16 in Using Dataiku

Looking for an API to do the above.

This can be done manually by going to a managed SQL dataset > settings > connection > test, or by going to dataset > settings > schema > check now.

Internally from developer console, it seems like one of the two following private API's are being called.

/dip/api/datasets/managed-sql/test/
/dip/api/datasets/test-schema-consistency

Best Answer

  • WH
    WH Registered Posts: 17 ✭✭✭✭
    edited July 17 Answer ✓

    API actually exists and I was able to use it successfully:

    1. Instantiate project flow with get_flow()

    2. call flow.start_tool(type="CHECK_CONSISTENCY") (docs)

    3. call tool.update() to get a future. Note that options are required, I used `

    options={
    "recheckAll": True,
    "datasets": {"consistencyWithData": True},
    "recipes": {"schemaConsistency": True, "otherExpensiveChecks": True},
    }

    4. call future.wait_for_result() that returns a dict of results.

    5. Parse results and voila!

Answers

Setup Info
    Tags
      Help me…