โ08-01-2024 10:42 PM
For example here I extract the schedule parameter as a complex type variable:
variables:
schedule:
description: schedule time
type: complex
default:
quartz_cron_expression: '0 22 17 * * ?'
timezone_id: Asia/Shanghai
pause_status: "UNPAUSED"
And here is how I use in my job definition:
resources:
jobs:
my_workflow_job:
name: โฆโฆ
schedule: ${var.schedule}
When I validate the yaml file via command: `databricks bundle validate -t dev -o json`, it told me:
Error: no value assigned to required variable schedule. Assignment can be done through the "--var" flag or by setting the BUNDLE_VAR_schedule environment variable
I donโt know whatโs wrong with my code, I follow the example in the document https://docs.databricks.com/en/dev-tools/bundles/settings.html#define-a-complex-variable to define the complex type variable
โ08-02-2024 02:25 AM
You are right, I solved the issue by upgrade the Databricks CLI. My local CLI version is 0.221. According to the release note, it looks like they support the complex variable since 0.222 only.
โ08-02-2024 01:30 AM
Itโs strange, it can pass the validation on my colleagueโs laptop. I still cannot pass the validation even restart my Terminal and Macbook
โ08-02-2024 02:17 AM - edited โ08-02-2024 02:22 AM
If the validation is fine on your colleague's laptop and not on yours, my first assumption would be that it's a version issue. Do you have the same Databricks CLI version as your colleagues? You can check with
databricks --version
Also according to this documentation, you need Databricks CLI version 0.218.0 or higher to use bundles.
โ08-02-2024 02:25 AM
You are right, I solved the issue by upgrade the Databricks CLI. My local CLI version is 0.221. According to the release note, it looks like they support the complex variable since 0.222 only.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group