learning-it by example

#203 Data governance 5.6 min

A Business Glossary in YAML With Four Python Checks

A glossary in a file, and four checks that find its four faults in a second.

1. Why should the terms of a business glossary be linked to table columns?
2. When the Python glossary checks ran on the made-up shop glossary, which broken link was reported?
3. When the Python glossary checks ran on the made-up shop glossary, how many columns were reported as having no term?
4. What can the four Python checks on a YAML business glossary not tell you?
5. Which of these is a mistake to avoid when building a business glossary?

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

  1. Fix the thin entry

    Copy the code folder first. In glossary.yaml give the Refund term an owner line and a definition of at least six words. Predict what the thin line of python run.py will print now, then run it. Did the other lines change?

    A hint

    The thin check looks for a missing owner or a definition under six words.

  2. Remove the shared synonym

    In glossary.yaml remove client from the synonyms of Active customer. Predict which line of output disappears, then run python run.py. Why is it better for a word to belong to only one term?

    A hint

    shared_words counts how many terms list each synonym and keeps those with more than one.

  3. Repair the broken link in two ways

    First add vat_gbp to the orders columns in schema.py and run python run.py. Predict whether the broken line disappears and whether the unlinked count changes. Then undo that, and instead change the link in glossary.yaml to a column that already exists. Which fix is right depends on what the column should be.

    A hint

    broken_links checks every linked column against all_columns. unlinked subtracts the linked columns from all columns.

  4. Change the thin threshold

    In check.py change the number 6 in the thin function to 12. Count the words in each definition in glossary.yaml and predict which terms will now be listed as thin. Run python run.py to check. Is a longer definition always a better one?

    A hint

    Python splits a definition on spaces to count words. Only definitions with fewer words than the limit are thin.

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 glossary with planted faults; the checks test the file's shape, not whether a definition is right.

Up next in Data governance

More in Data governance

All Data governance videos

Related videos