Where datagroups live

I’m trying to update https://github.com/ww-tech/lookml-tools's linter. I’m coming across datagroups for the first time and I’m unclear where they live and what is valid.

In one of our repos, I’m seeing a view file that just contains a set of datagroups. No view key, just a set of datagroups. The Looker UI validator validates it. However, the docs (https://docs.looker.com/reference/view-reference) do not list datagroup as a valid key. So which is it: valid or not valid?

P.S. the looker admin datagroup view is showing green lights against them

0 3 190
3 REPLIES 3

any ideas @fabio1 or @joshtemple (lkml parses it OK) ?

Hi Carl,

datagroups, as objects, are part of a model.

The file that they are defined in, or the filetype of that file, are purely for organization. (You could include explores in view files too)

Contrast this with including the datagroup object within the view object itself, which I believe would be rejected by native LookML validation.

In practice, we often put our datagroups in a dedicated datagroups.lkml file. This has the benefit of enhancing their reuseability across models, as well as (in my preferred style) allowing you to include the datagroup(s) from the view file, rather than from the model file, for clearer dependency declarations

Thanks @fabio1. That gives me great context and makes sense now

Top Labels in this Space
Top Solution Authors