Skip to content

Commit ad87cdc

Browse files
committed
acc: record how presets handle a whole-schedule or whole-trigger reference and a referenced name
1 parent c3ff2ce commit ad87cdc

18 files changed

Lines changed: 100 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
bundle:
2+
name: test-bundle
3+
4+
presets:
5+
name_prefix: "pre-"
6+
7+
resources:
8+
jobs:
9+
base:
10+
name: base
11+
schedule: {quartz_cron_expression: "0 0 * * * ?", timezone_id: UTC}
12+
trigger: {file_arrival: {url: "s3://bucket/path"}}
13+
tasks: [{task_key: t, notebook_task: {notebook_path: ./nb.py}}]
14+
viaref:
15+
name: viaref
16+
name: ${resources.jobs.base.name}
17+
tasks: [{task_key: t, notebook_task: {notebook_path: ./nb.py}}]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Databricks notebook source
2+
print(1)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cloud = false
2+
EnvMatrix.DMS = ["", "true"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
>>> [CLI] bundle plan -o json
3+
{
4+
"resources.jobs.viaref": "pre-pre-base"
5+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# name_prefix is added to a name that is a reference to the name of another job, which has the prefix too.
2+
trace $CLI bundle plan -o json | jq '.plan | del(.["resources.jobs.base"]) | map_values(.new_state.value.name)'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Badness = "name_prefix is added a second time to a name that is a reference to the name of another job."
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
bundle:
2+
name: test-bundle
3+
4+
presets:
5+
trigger_pause_status: PAUSED
6+
7+
resources:
8+
jobs:
9+
base:
10+
name: base
11+
schedule: {quartz_cron_expression: "0 0 * * * ?", timezone_id: UTC}
12+
trigger: {file_arrival: {url: "s3://bucket/path"}}
13+
tasks: [{task_key: t, notebook_task: {notebook_path: ./nb.py}}]
14+
viaref:
15+
name: viaref
16+
schedule: ${resources.jobs.base.schedule}
17+
tasks: [{task_key: t, notebook_task: {notebook_path: ./nb.py}}]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Databricks notebook source
2+
print(1)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Cloud = false
2+
EnvMatrix.DMS = ["", "true"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
>>> musterr [CLI] bundle validate
3+
Error: expected a map to index "pause_status", found string
4+
5+
Name: test-bundle
6+
Target: default
7+
Workspace:
8+
User: [USERNAME]
9+
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default
10+
11+
Found 1 error

0 commit comments

Comments
 (0)