Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### Bundles

* `bundle generate job` now downloads workspace files referenced by `spark_python_task`, rewriting them to a relative path like it already does for notebooks. Git-sourced files and cloud URIs are left untouched ([#5799](https://github.com/databricks/cli/pull/5799)).
* `bundle run --only` help now documents the `+` modifier syntax: prefix a task key with `+` to also run its upstream tasks, or suffix it with `+` for downstream tasks ([#5760](https://github.com/databricks/cli/pull/5760)).

### Dependency updates

Expand Down
2 changes: 1 addition & 1 deletion acceptance/bundle/help/bundle-run/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Usage:
databricks bundle run [flags] [KEY]

Job Flags:
--only strings comma separated list of task keys to run
--only strings comma separated list of task keys to run. Prefix a key with + to also run its upstream tasks. Suffix with + to also run its downstream tasks
--params stringToString comma separated k=v pairs for job parameters (default [])

Job Task Flags:
Expand Down
28 changes: 28 additions & 0 deletions acceptance/bundle/run/jobs/partial_run/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,31 @@ Hello from notebook2!
]
}
}

>>> [CLI] bundle run my_job --only +task_1,task_2+
Run URL: [DATABRICKS_URL]/jobs/[NUMID]/runs/[NUMID]?o=[NUMID]

[TIMESTAMP] "my_job" RUNNING
[TIMESTAMP] "my_job" TERMINATED SUCCESS
Output:
=======
Task task_1:
Hello from notebook1!

=======
Task task_2:
Hello from notebook2!


>>> print_requests.py //jobs/run-now
{
"method": "POST",
"path": "/api/2.2/jobs/run-now",
"body": {
"job_id": [NUMID],
"only": [
"+task_1",
"task_2+"
]
}
}
4 changes: 4 additions & 0 deletions acceptance/bundle/run/jobs/partial_run/script
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ trace musterr $CLI bundle run my_job --only non_existent_task,task_1
# We expect these values to be send through
trace $CLI bundle run my_job --only "task1.table1,task2>,task3>table3"
trace print_requests.py //jobs/run-now

# + modifiers (run upstream/downstream tasks) are forwarded unchanged
trace $CLI bundle run my_job --only "+task_1,task_2+"
trace print_requests.py //jobs/run-now
2 changes: 1 addition & 1 deletion bundle/run/job_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type JobOptions struct {

func (o *JobOptions) DefineJobOptions(fs *flag.FlagSet) {
fs.StringToStringVar(&o.jobParams, "params", nil, "comma separated k=v pairs for job parameters")
fs.StringSliceVar(&o.only, "only", nil, "comma separated list of task keys to run")
fs.StringSliceVar(&o.only, "only", nil, "comma separated list of task keys to run. Prefix a key with + to also run its upstream tasks. Suffix with + to also run its downstream tasks")
}

func (o *JobOptions) DefineTaskOptions(fs *flag.FlagSet) {
Expand Down