databricks-cli/libs/dyn/dynvar
Andrew Nester 5f42791609
Added support for complex variables (#1467)
## Changes
Added support for complex variables

Now it's possible to add and use complex variables as shown below

```
bundle:
  name: complex-variables

resources:
  jobs:
    my_job:
      job_clusters:
        - job_cluster_key: key
          new_cluster: ${var.cluster}
      tasks:
      - task_key: test
        job_cluster_key: key

variables:
  cluster:
    description: "A cluster definition"
    type: complex
    default:
      spark_version: "13.2.x-scala2.11"
      node_type_id: "Standard_DS3_v2"
      num_workers: 2
      spark_conf:
        spark.speculation: true
        spark.databricks.delta.retentionDurationCheck.enabled: false
```

Fixes #1298

- [x] Support for complex variables
- [x] Allow variable overrides (with shortcut) in targets
- [x] Don't allow to provide complex variables via flag or env variable
- [x] Fail validation if complex value is used but not `type: complex`
provided
- [x] Support using variables inside complex variables 

## Tests
Added unit tests

---------

Co-authored-by: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com>
2024-06-26 10:25:32 +00:00
..
lookup.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
lookup_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
ref.go Added support for complex variables (#1467) 2024-06-26 10:25:32 +00:00
ref_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
resolve.go Retain location information of variable reference (#1333) 2024-04-03 10:40:29 +00:00
resolve_test.go Added support for complex variables (#1467) 2024-06-26 10:25:32 +00:00