#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.
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.
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.
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.
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.
