Content Validation

On this Page
Docs Menu

Please note that the Content Validator is a Labs feature that must be enabled.

After making a change to your LookML model, you may want to check that your changes did not impact any of your users’ saved Looks. For example, if you change a field name from customer to user, any Looks that included the customer field will no longer function (unless you used the alias parameter).

Starting Content Validation

To check and fix saved Looks, click Content Validator in the Develop menu:

Viewing the Content Validation Results

Content validation runs automatically when you start the Content Validator.

The content validation results show Looks that use model names, explore names, view names, or field names that do not exist or can’t be found. This is often due to a typo or a missing join.

If you are in production mode, validation results are based on the production mode LookML. If you are in development mode, the results are based on your development mode LookML.

This is how the Content Validator is used:

  1. Click the Validate Again button in the upper left if you need to run validation again.
  2. If you want to make a change for all Looks on your instance, regardless of error, you can choose the Find & Replace All Looks button.
  3. Specify your preferred grouping. By default, Look errors are grouped by their specific error. However, if you prefer to view the errors grouped by the Space in which they occur, or the Look in which they occur, you can change the setting in the upper right.
  4. If you are in development mode, it’s important to understand the implications of changing Looks. If you “fix” them before making your breaking changes live, there will be a period of time when the fix is pre-mature, so users will experience broken Looks. Looker provides a warning message to help you remember this.
  5. The error table displays a list of saved Look errors, along with the Looks that contain them, and the underlying model and explore that are producing the error.
  6. The Replace and Replace or Remove buttons are provided intelligently based on the error type. They provide functionality to fix the errors and are described in more detail below.

Fixing Errors

The basic purpose of content validation to deal with a breaking change in your LookML, and you want to edit any impacted Looks - in bulk - to make use of the new LookML. You may also want to use content validation even when you haven’t introduced a breaking change. For example, you might decide that you prefer one field over another and want to make that replacement in all Looks, even though there is no error.

You can rename model, explore, view, and field names in Looks, including any view and field names used in custom filters or table calculations.

You also can remove any fields that are included in the Data section of a Look. However, you will not be able to remove fields from custom filters or table calculations, because typically you would need to make additional changes to keep the expression working. Instead, use the content validation error messages to find Looks where the custom filters and table calculation expression needs to be fixed, then rework the expression as appropriate.

You must be extremely careful when making changes using content validation. It does not have an un-do function, and it has the potential to impact many Looks at the same time. If you do make a mistake attempt to correct it as soon as possible, before additional changes make it harder to isolate the affected Looks.

When to Fix Validation Errors

When you push development changes to production you should fix affected Looks at approximately the same time, so that the Looks are broken for the minimum amount of time. If you fix Looks too early, based on your development mode work, users will experience broken Looks until you push your changes. Similarly, if you delay in fixing Looks until long after pushing the change, users will experience broken Looks until you fix them.

Adjusting All Looks

To adjust all Looks, regardless of whether or not they have an error, click the Find & Replace All Looks button in the upper left.

Looker will display the following dialog:

To use this feature:

  1. Select the type of LookML element you want to change.
  2. Enter the name of the item you want to replace or remove.
  3. When changing views, explores, and models, you must enter a new name. When changing a field you can enter a new name, or leave it blank to remove the field.
  4. Click the purple button to make the change.

Adjusting Error Looks Only

To adjust a set of Looks that share the same error, click the Replace or Replace or Remove button to the right of the error in the Action column.

This will bring up a dialog that is appropriate for the error in question. For example, an “unknown explore” error would create a dialog like this:

To use this feature:

  1. Select the type of LookML element you want to change. In some cases, multiple options are presented in case various LookML elements come into play.
  2. Enter the name of the item you want to replace or remove. This will be filled in for you and should be correct.
  3. Enter the new name of the item. In the case of a field error, you can also choose to leave this blank, which will simply remove the field.
  4. Click the purple button to make the change.

Things to Consider

Plan to rerun content validation to view the results of any fixes you make.

Content validation blocks some actions to help you avoid making mistakes:

  • You can change the name of a view, explore, or model, but you cannot remove them.
  • You can remove a field from the Data section of a Look, but not its custom filter or table calculation expressions.
  • Table calculations may only reference fields that are included in the query of a Look. Therefore, if you remove a field from the Data section of a Look, but a table calculation still contains that field, you’ll get a new error during content validation for that Look.
Still have questions?
Go to Discourse - or - Email Support
Top