Skip to content

Instantly share code, notes, and snippets.

@bplmp
Created August 10, 2020 18:55
Show Gist options
  • Select an option

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

Select an option

Save bplmp/45df99cc75ded159c55eb3f436ef580c to your computer and use it in GitHub Desktop.
Sample LookML test for avg measures
def test_avg_prefix_in_measures():
"""All average measures must be prefixed with avg_
"""
errors = []
for lkml_file in LKML_MEASURES:
for measure in lkml_file['measures']:
if measure['type'] == 'average' and measure['name'][:4] != 'avg_':
errors.append(lkml_file['path'])
if errors:
assert False, errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment