Skip to content

Enable references to workspace variables #60

@Skuvrik

Description

@Skuvrik

In short:

It should be possible to reference workspace variables in either the substitution files directly or via the databricks file.

Proposal:

In many projects, schemas in development has a unique prefix to enable parallel development.

To enable references to unique schemas for each developer, it should not be necessary to change variables manually in the substitution files.
It should be possible to make a reference directly to workspace variables in the substitution file i.e. ${workspace.current_user.id}.
Or, by referencing variables in the databricks file from the substitution file, i.e ${var.dev_prefix} in substitutions, and dev_prefix dev_${workspace.current_user.id} in the databricks file.

Example:

Referencing a variable in databricks.yml:
substitutions/dev.yaml

dev:
  raw_schema: ${var.dev_prefix}raw
  bronze_schema: ${var.dev_prefix}bronze

databricks.yml

variables:
   dev_prefix:
      description: "Prefix for development environment schemas"
      default: ''
targets:
   dev:
       variables:
         dev_prefix: dev_${workspace.current_user.id}_

OR

Referencing workspace variables directly:
substitutions/dev.yaml

dev:
  raw_schema: dev_${workspace.current_user.id}_raw
  bronze_schema: dev_${workspace.current_user.id}_bronze

Both result in

raw_schema = "dev_13829_raw"
bronze_schema = "dev_13829_bronze"

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions