Created
August 10, 2020 18:55
-
-
Save bplmp/45df99cc75ded159c55eb3f436ef580c to your computer and use it in GitHub Desktop.
Sample LookML test for avg measures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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