learning-it by example

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

1. In the Python UK GDPR data map example, how is the data map kept?
2. In the Python data map check on the made-up shop's 5 activities, how many needed work?
3. In the Python data map check on the made-up shop, what was wrong with the Newsletter activity?
4. Which problem does the Python data map check report for special category data such as health?
5. What does the Python data map check actually test?
6. What is the tip for keeping a data map and its Python check up to date?

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

  1. 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?

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

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

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

All Data governance videos

Related videos