#209 Data governance 5.2 min
UK GDPR Data Map as Code: A Practical Checklist
A UK GDPR data map in a file, and a 15-line check that found 3 of 5 activities to fix.
Fix the three problems
Copy the code folder first. In datamap.json fill in the empty safeguard for the Newsletter, the empty condition for Staff sickness records, and the empty purpose and retention for Website analytics, each with any text. Run python run.py. You should see every activity say OK and the last line say 5 activities, 0 need work.
A hint
Then think: does filling in a field with any text make the answer correct?
Require an owner
In check.py add "owner" to the end of the REQUIRED tuple and run python run.py. You should see every activity report no owner, so the last line says 5 activities, 5 need work. Add an owner field to one activity in datamap.json and run again.
A hint
The video's next steps suggest adding an owner and a review date.
Add a new activity abroad
In datamap.json add a sixth activity, a copy of Order fulfilment with a new name, "country": "FR" and "special_category": true. Predict the lines the check prints for it, then run python run.py and compare.
A hint
The check wants a safeguard for any country that is not UK, and a condition for special category data.
Add a check of your own
In check.py add a rule to the problems function: if the retention field is empty, add the text retention missing to the found list in your own wording. Predict which activity it will catch, then run python run.py. Say why the original check already reports this one.
A hint
Look at what the REQUIRED tuple already contains.
These tasks are for you to try on your own machine. Nothing is checked or saved.
What this does not show
Made-up shop and data map; the check only tests that fields are filled in, not that they are right, and this is not legal advice.
Up next in Data governance
More in Data governance
Related videos
- #204 Tag PII Columns in Python, Including a False Positive Data governance
- #208 Right to Erasure Across a Pipeline: Delete, Scan, Restore Data governance
- #19 Redact Personal Data Before Your LLM Sees It (Python) AI security and governance
- #203 A Business Glossary in YAML With Four Python Checks Data governance
