databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

Cannot interpolate variable from target #1786

Closed ChintanpatelTH closed 5 days ago

ChintanpatelTH commented 6 days ago

Describe the issue

Variable substitutions stopped working from target. If target has variables with description then It's not working.

For example : If I provide description to name variable. It doesn't work. If I remove description it works.

databricks.yml

targets:
  dev:
    mode: development
    default: true
    workspace:
      host: https://dbc-e27abc0b-645c.cloud.databricks.com
    variables:
      name:
        description: "name of job"
        default: "job_1"

Configuration

databricks.yml

include:
  - resources/*.yml

targets:
  dev:
    mode: development
    default: true
    workspace:
      host: https://dbc-e27abc0b-645c.cloud.databricks.com
    variables:
      name:
        description: "name of job"
        default: "job_1"

resources/project.yml

# The main job for my_project.
variables:
  name:
    description: Job name

resources:
  jobs:
    my_project_job:
      name: ${var.name}

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Run databricks bundle validate --target dev
  2. I'm getting this error : cannot interpolate non-string value: ${var.name}

Expected Behavior

Validation and deployment should work after replacing variable name value.

Actual Behavior

I'm getting following error for bundle validate and bundle deploy commands cannot interpolate non-string value: ${var.name}

OS and CLI version

Operating System : Mac 15.0 CLI Version : v0.228.0

Is this a regression?

Yes It was working with v0.223.2 when I checked last time.

Debug Logs

Output logs if you run the command with debug logs enabled. Example: databricks bundle deploy --log-level=debug. Redact if needed

ChintanpatelTH commented 5 days ago

@andrewnester Thank you! When this fix will be available ?

andrewnester commented 4 days ago

It will be released in the next CLI release most likely next week