Skip to content

Instantly share code, notes, and snippets.

@bplmp
Created August 4, 2020 13:59
Show Gist options
  • Select an option

  • Save bplmp/d22b82ee3d038cf24891083966691916 to your computer and use it in GitHub Desktop.

Select an option

Save bplmp/d22b82ee3d038cf24891083966691916 to your computer and use it in GitHub Desktop.
Sample LookML test for descriptions in dimensions
def test_descriptions_in_dimensions():
"""All dimensions must have descriptions
"""
errors = []
for lkml_file in LKML_DIMENSIONS:
dimensions_with_errors = []
for dimension in lkml_file['dimensions']:
if 'description' not in dimension:
dimensions_with_errors.append(dimension['name'])
if dimensions_with_errors:
errors.append({'file': lkml_file['path'], 'dimensions': dimensions_with_errors})
if errors:
assert False, errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment