-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report "dangling" content validator errors #572
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this! I have some feedback below. Also, regarding tests: have you added any tests that explicitly test for this situation? That would be good to do in addition to refactoring existing ones.
Co-authored-by: Josh Temple <8672171+joshtemple@users.noreply.github.com>
@@ -410,7 +440,7 @@ def build_project( | |||
fields = ["name", "project_name", "explores"] | |||
for lookmlmodel in client.get_lookml_models(fields=fields): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how important this is, but we loop through models 4 times (441, 459, 467, 477). Do you think we can consolidate some of these loops? I don't consider it blocking for the PR but if you have some time it might give us a bit of efficiency and readability.
Change description
We currently prune the LookML tree when building the project. This means that content validator errors relating to explores that don't exist anymore don't get reported by Spectacles. This PR changes this functionality so that these errors now appear.
The changes work in the following way:
get_results
function. This will only happen during the content validator. When this occurs, we prune the errors to just the relevant LookML tree.This changes mean that we will now return all content validation errors relevant to a project, except for those that are linked to models that don't exist anymore. There is no way for us to know where to attach those, so they will remain dangling.
Type of change
Related issues
Closes #240
Checklists
Security
Code review