Skip to content

Commit a4ba0bb

Browse files
Add sub-extension to resource files in built-in templates (#1777)
## Changes We want to encourage a pattern of only specifying a single resource in a YAML file when an `.<resource-type>.yml` (like `.job.yml`) is used. This convention could allow us to bijectively map a resource YAML file to it's corresponding resource in the Databricks workspace. This PR simply makes the built-in templates compliant to this format. ## Tests Existing tests.
1 parent b3a3071 commit a4ba0bb

File tree

11 files changed

+9
-9
lines changed

11 files changed

+9
-9
lines changed

libs/template/templates/dbt-sql/template/{{.project_name}}/README.md.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ You can find that job by opening your workpace and clicking on **Workflows**.
121121

122122
You can also deploy to your production target directly from the command-line.
123123
The warehouse, catalog, and schema for that target are configured in databricks.yml.
124-
When deploying to this target, note that the default job at resources/{{.project_name}}_job.yml
124+
When deploying to this target, note that the default job at resources/{{.project_name}}.job.yml
125125
has a schedule set that runs every day. The schedule is paused when deploying in development mode
126126
(see https://docs.databricks.com/dev-tools/bundles/deployment-modes.html).
127127

libs/template/templates/dbt-sql/template/{{.project_name}}/resources/{{.project_name}}_job.yml.tmpl renamed to libs/template/templates/dbt-sql/template/{{.project_name}}/resources/{{.project_name}}.job.yml.tmpl

File renamed without changes.

libs/template/templates/default-python/template/__preamble.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ This file only template directives; it is skipped for the actual output.
1818

1919
{{if $notDLT}}
2020
{{skip "{{.project_name}}/src/dlt_pipeline.ipynb"}}
21-
{{skip "{{.project_name}}/resources/{{.project_name}}_pipeline.yml"}}
21+
{{skip "{{.project_name}}/resources/{{.project_name}}.pipeline.yml"}}
2222
{{end}}
2323

2424
{{if $notNotebook}}
2525
{{skip "{{.project_name}}/src/notebook.ipynb"}}
2626
{{end}}
2727

2828
{{if (and $notDLT $notNotebook $notPython)}}
29-
{{skip "{{.project_name}}/resources/{{.project_name}}_job.yml"}}
29+
{{skip "{{.project_name}}/resources/{{.project_name}}.job.yml"}}
3030
{{else}}
3131
{{skip "{{.project_name}}/resources/.gitkeep"}}
3232
{{end}}

libs/template/templates/default-python/template/{{.project_name}}/README.md.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The '{{.project_name}}' project was generated by using the default-python templa
2929
```
3030

3131
Note that the default job from the template has a schedule that runs every day
32-
(defined in resources/{{.project_name}}_job.yml). The schedule
32+
(defined in resources/{{.project_name}}.job.yml). The schedule
3333
is paused when deploying in development mode (see
3434
https://docs.databricks.com/dev-tools/bundles/deployment-modes.html).
3535

libs/template/templates/default-python/template/{{.project_name}}/resources/{{.project_name}}_job.yml.tmpl renamed to libs/template/templates/default-python/template/{{.project_name}}/resources/{{.project_name}}.job.yml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ resources:
4040
- task_key: notebook_task
4141
{{- end}}
4242
pipeline_task:
43-
{{- /* TODO: we should find a way that doesn't use magics for the below, like ./{{project_name}}_pipeline.yml */}}
43+
{{- /* TODO: we should find a way that doesn't use magics for the below, like ./{{project_name}}.pipeline.yml */}}
4444
pipeline_id: ${resources.pipelines.{{.project_name}}_pipeline.id}
4545
{{end -}}
4646
{{- if (eq .include_python "yes") }}

libs/template/templates/default-python/template/{{.project_name}}/resources/{{.project_name}}_pipeline.yml.tmpl renamed to libs/template/templates/default-python/template/{{.project_name}}/resources/{{.project_name}}.pipeline.yml.tmpl

File renamed without changes.

libs/template/templates/default-python/template/{{.project_name}}/src/dlt_pipeline.ipynb.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": [
1515
"# DLT pipeline\n",
1616
"\n",
17-
"This Delta Live Tables (DLT) definition is executed using a pipeline defined in resources/{{.project_name}}_pipeline.yml."
17+
"This Delta Live Tables (DLT) definition is executed using a pipeline defined in resources/{{.project_name}}.pipeline.yml."
1818
]
1919
},
2020
{

libs/template/templates/default-python/template/{{.project_name}}/src/notebook.ipynb.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"source": [
1515
"# Default notebook\n",
1616
"\n",
17-
"This default notebook is executed using Databricks Workflows as defined in resources/{{.project_name}}_job.yml."
17+
"This default notebook is executed using Databricks Workflows as defined in resources/{{.project_name}}.job.yml."
1818
]
1919
},
2020
{

libs/template/templates/default-sql/template/{{.project_name}}/resources/{{.project_name}}_sql_job.yml.tmpl renamed to libs/template/templates/default-sql/template/{{.project_name}}/resources/{{.project_name}}_sql.job.yml.tmpl

File renamed without changes.

libs/template/templates/default-sql/template/{{.project_name}}/src/orders_daily.sql.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- This query is executed using Databricks Workflows (see resources/{{.project_name}}_sql_job.yml)
1+
-- This query is executed using Databricks Workflows (see resources/{{.project_name}}_sql.job.yml)
22

33
USE CATALOG {{"{{"}}catalog{{"}}"}};
44
USE IDENTIFIER({{"{{"}}schema{{"}}"}});

0 commit comments

Comments
 (0)