Comment
09-09-2025
09:04 AM
09-09-2025
09:04 AM
Hi, great post!
I am trying to dynamically change in the targets section the variables defined in the databricks.yml file. Eg:
# databricks.yml
variables:
catalog:
description: The Unity Catalog catalog to use.
default: my_catalog
schema:
description: The Unity Catalog schema basename to use as a prefix for all created schemas. bundle.target will be appended to this value.
default: my_schema
landing_data_volume:
description: The volume to use for landing data.
default: /Volumes/my_catalog/my_schema/landing_data
my ultimate goal is to use these variables in the targets section, in order to append a suffix such as "dev" to the schema to be deployed in the dev environment. However, a syntax like this:
# databricks.yml
targets:
dev:
mode: development
variables:
catalog: ${workspace.current_user.short_name}
schema: ${var.schema}
default: true
workspace:
host: https://my_host.cloud.databricks.com
results in the following error:
Error: cycle detected in field resolution: variables.schema.default -> var.schema -> var.schema
which way would you recommend to sort this out?
Many thanks,
Domenico