Usage
local_dependency: { project: "other_project" override_constant: constant_name { value:"string" } }
|
Hierarchy
local_dependency |
Default value
None
Accepts
|
Definition
local_dependency specifies the name of another LookML project that has files that you want to use in this project. When importing files from another project, you must create a manifest file and use the local_dependency parameter to specify a project from which to import files.
You can use the project subparameter of local_dependency to specify the name of a single project to import files from. To import files from multiple projects, you can include multiple local_dependency statements in the manifest file.
Constants can also be passed between projects using project import, and the override_constant parameter can be used to override the constant's value in the importing project. After you have added local_dependency parameters to specify other projects, use the include parameter to add individual files.
The Looker IDE automatically creates an imported_projects folder when you import a project. Files from both local projects and remote projects are listed in the imported_projects folder. See the Working with folders in the IDE documentation page for more information.
Example
In a manifest file, add the projects "IMPORTED_PROJECT_1" and "IMPORTED_PROJECT_2" as sources to import files from:
project_name: "thelook"
local_dependency: {
project: "IMPORTED_PROJECT_1"
}
local_dependency: {
project: "IMPORTED_PROJECT_2"
}
Things to know
Overriding imported constants with override_constant
The
override_constantparameter can also be used with theremote_dependencyparameter for remote project import.
When importing files from one project into another, you can override the values of constants defined in the imported project's manifest file. When you override a constant's value, imported files that reference that constant will use the new value provided in the importing project.
When the export parameter is set to override_required or override_optional for a constant defined in the imported project, the override_constant subparameter of local_dependency can be used to provide a new value for that constant. For example, suppose you have a constant schema defined in the imported project's manifest file:
constant: schema {
value: "imported_project_schema"
export: override_required
}
In this example, because the export parameter is set to override_required, its value must be overridden in the importing project's manifest file:
project_name: "importing_project"
local_dependency: {
project: "imported_project"
override_constant: schema {
value: "importing_project_schema"
}
}
See the Importing files from other projects documentation for more information and another example of overriding constants in importing projects.