Commit 008b72a
authored
pipelines: add generate command (#4251)
## Changes
Add `databricks pipelines generate` command that generates DAB resources
from SDP YAML.
`generate` command is tailored to `lakeflow-pipelines` template where
`src` folder contains pipeline folders, for example:
```
├── databricks.yml
├── pyproject.toml
├── README.md
├── resources
│ ├── my_pipeline.pipeline.yml
│ └── my_pipeline.job.yml
└── src
└── my_pipeline
├── spark-pipeline.yml
└── transformations
├── example_python_materialized_view.py
└── example_sql_materialized_view.sql
```
### Usage
```
$ databricks pipelines generate src/my_pipeline
```
Where `src/my_pipeline/sdp-pipeline.yml`:
```yaml
name: My Pipeline
storage: file:///Users/foo/bar/baz
libraries:
- glob:
include: transformations/**
```
Produces `resources/my_pipeline.pipeline.yml`:
```yaml
resources:
pipelines:
my_pipeline:
name: My Pipeline
catalog: ${var.catalog}
schema: ${var.schema}
root_path: ../src/my_pipeline
serverless: true
libraries:
- glob:
include: ../src/my_pipeline/transformations/**
environment:
dependencies:
- --editable ${workspace.file_path}
```
## Why
It allows creating DAB YAML for Spark Declarative Pipelines
## Tests
Acceptance and unit tests1 parent 6d99db8 commit 008b72a
File tree
27 files changed
+661
-0
lines changed- acceptance/pipelines
- databricks-cli-help
- generate
- bad-path
- discover-spark-pipeline-yml
- output
- src/my_pipeline
- fail-overwrite
- resources
- src/my_pipeline
- simple
- output
- src/my_pipeline
- install-pipelines-cli
- pipelines-cli-help
- cmd/pipelines
27 files changed
+661
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments