From bc1610f6e6ffe329f312492a8dc35ca49cb9a8f3 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Thu, 16 Jan 2025 13:14:00 +0100 Subject: [PATCH] Add a test for complex variable resolution with 3 levels (#2163) Follow up to #2157. That PR repeated variable resolution. This test still does not resolve fully but would resolve with 3 passes. This is slightly different from complex-transitive-deeper - this test does not show any errors, the issue is purely not enough passes. --- .../complex-transitive-deep/databricks.yml | 21 +++++++++++++++++++ .../complex-transitive-deep/output.txt | 3 +++ .../variables/complex-transitive-deep/script | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 acceptance/bundle/variables/complex-transitive-deep/databricks.yml create mode 100644 acceptance/bundle/variables/complex-transitive-deep/output.txt create mode 100644 acceptance/bundle/variables/complex-transitive-deep/script diff --git a/acceptance/bundle/variables/complex-transitive-deep/databricks.yml b/acceptance/bundle/variables/complex-transitive-deep/databricks.yml new file mode 100644 index 000000000..1357c291a --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deep/databricks.yml @@ -0,0 +1,21 @@ +bundle: + name: complex-transitive + +variables: + catalog: + default: hive_metastore + spark_conf_1: + default: + "spark.databricks.sql.initial.catalog.name": ${var.catalog} + spark_conf: + default: ${var.spark_conf_1} + etl_cluster_config: + type: complex + default: + spark_version: 14.3.x-scala2.12 + runtime_engine: PHOTON + spark_conf: ${var.spark_conf} + +resources: + clusters: + my_cluster: ${var.etl_cluster_config} diff --git a/acceptance/bundle/variables/complex-transitive-deep/output.txt b/acceptance/bundle/variables/complex-transitive-deep/output.txt new file mode 100644 index 000000000..a031e0497 --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deep/output.txt @@ -0,0 +1,3 @@ +{ + "spark.databricks.sql.initial.catalog.name": "${var.catalog}" +} diff --git a/acceptance/bundle/variables/complex-transitive-deep/script b/acceptance/bundle/variables/complex-transitive-deep/script new file mode 100644 index 000000000..52bb08ed4 --- /dev/null +++ b/acceptance/bundle/variables/complex-transitive-deep/script @@ -0,0 +1,2 @@ +# Currently, this incorrectly outputs variable reference instead of resolved value +$CLI bundle validate -o json | jq '.resources.clusters.my_cluster.spark_conf'