What is the best way to do model inheritance in the short-term while Looker doesn’t support it?
We have a staging model and a production model. They’re the same except with different connections. Currently we’ve put all of the explores into a file explores.dashboard.lookml
but I was wondering if there’s a way to put these explores into explores.model.lookml
without getting all of the errors about a connection being required in that file.
We don’t put connection definitions in our models. (We may not be required to because we only have 1 connection.) However, a fast and potentially valuable experiment is to make a new model file. Then cut and paste the base view definitions into the new file. Make sure the new model file does NOT have a connection definition. Then change the two dependent models to include the new model file (but don’t redefine the baseviews). Have the connection information in the two dependent model files. Save everything and test it.
Because you can include model files in other model files this could solve your problem.
Yeah that’s fine. It’d be nice if this were sorted into the Models section of the UI, but not a high priority.
I was beginning to migrate to a similar process .dashboard.lookml
, I created new files and named them .m.lookml
. The nice thing is they show up in a separate area in the project under OTHER. Unfortunately they only can be initially created outside of Looker (via GitHub in my case).
The way I am actually using this is that I have multiple databases in production but only one is development. When pushing to production only the .m
files are copied and the static .models
simply handle the connection
and include
details.
A belated update to this topic, in Looker 3.24 we introduced the extends
LookML parameter. In short, it allows one to build off of views, adding new fields and filters. It’s really slick, I encourage everyone to take a look at this tutorial.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.