wjohnson/pyapacheatlas

get_term throws KeyError:'terms' if the Glossary is empty

Closed this issue · 1 comments

Describe the bug
get_term function throwns an exception if the Glossary is empty

Stack trace
[2022-11-28T10:26:09.886Z] File ".venv/lib/python3.9/site-packages/pyapacheatlas/core/glossary/glossaryclient.py", line 135, in get_term
[2022-11-28T10:26:09.886Z] for term in terms_in_glossary["terms"]:
[2022-11-28T10:26:09.886Z] KeyError: 'terms'

Expected behavior
No exception is thrown if the Glossary is empty. None is returned.

Screenshots
Check that the key exists before trying to access it
image.

Desktop (please complete the following information):

  • OS: Windows
  • PyApacheAtlas Version (python -m pyapacheatlas --version): 0.14.0

Thank you SO Much, @adinastoll for reporting this issue! I will try to knock out a fix for it this weekend!