learning-it by example

#210 Data governance 5.3 min

A Data Quality Scorecard That Shows a Hidden Failure

Orders averaged 97.7 percent, amber. One critical check made it red.

1. In the Python data quality scorecard, what does each check return?
2. In the Python data quality scorecard on the made-up tables, the orders domain averaged 97.7 percent. What colour did the scorecard give it, and why?
3. What colour limits does the Python data quality scorecard code use?
4. In the made-up orders table of the scorecard demo, why is the id unique rate only 94 percent?
5. In the data quality scorecard demo, where does the idea of a critical rule that forces red come from?
6. Why can a pass rate alone mislead a leader?

Practice only: nothing is saved and no score counts towards anything. Each answer comes with the reason.

  1. Take the critical flag off

    Copy the code folder first. In scorecard.py change the True after checks.unique("id") in the orders row to False and run python run.py. You should see orders drop to amber at 97.7%, because only the average counts now. Undo this change afterwards, so the next exercises give the numbers they state.

    A hint

    The third value in each rule says whether it is critical.

  2. Move the colour limits

    In scorecard.py change the colour function so green needs 99.5 and amber needs 98. Predict the colour of each domain before you run python run.py, then check. You should see customers and products turn amber, and orders stay red. Undo this change afterwards, so the next exercises give the numbers they state.

    A hint

    Customers and products both average 99.0 percent.

  3. Make the large order normal

    In data.py change orders[3]["total_gbp"] = 25000.0 to 25.0. Predict the orders line before you run python run.py. You should see orders at 98.0% and still red, with the average alone green.

    A hint

    The unique id check is still at 94 percent.

  4. Fix the duplicate ids

    In data.py change the id in the orders list to just i, instead of i % 94 if i >= 94 else i. Run python run.py. You should see orders rise to 99.7% and turn green, with no critical note.

    A hint

    The planted fault was in the ids of the last six rows.

These tasks are for you to try on your own machine. Nothing is checked or saved.

What this does not show

Three made-up tables with planted faults; the colour limits are one vendor's example, the critical rule is my own, and a pass rate says nothing about impact.

Up next in Data governance

More in Data governance

All Data governance videos

Related videos