Skip to content

DLT init reusing lakeflow-pipelines template#2

Open
alyssa-db wants to merge 1 commit intoinstall-dlt-featfrom
dlt-init
Open

DLT init reusing lakeflow-pipelines template#2
alyssa-db wants to merge 1 commit intoinstall-dlt-featfrom
dlt-init

Conversation

@alyssa-db
Copy link
Owner

@alyssa-db alyssa-db commented Jun 17, 2025

Changes

New dlt init command that generates a pipeline specific template.
Adding new field to schema that allows for reusing lakeflow-pipelines template for DLT

Why

Allow for dlt init command to reuse template

Tests

Acceptance tests pending but locally generates 2 sets of files if using databricks bundle init or dlt init

Copy link

@shreyas-goenka shreyas-goenka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we considered creating a new independent template for this? Being surgical here can be more complex than just having a new template.

For example: The Readme in lakeflow-pipelines template has a bunch of references to the databricks that you would probably like to change to dlt.

"is_dlt": {
"skip_prompt_if": {},
"type": "boolean",
"description": "DLT pipelines using this template",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"description": "DLT pipelines using this template",
"description": "Whether this template is initialized via the DLT CLI",

# This is a Databricks asset bundle definition for {{.project_name}}.
# See https://docs.databricks.com/dev-tools/bundles/index.html for documentation.
bundle:
{{$isDLT := eq .is_dlt true}}{{if $isDLT}}project{{else}}bundle{{end}}:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{$isDLT := eq .is_dlt true}}{{if $isDLT}}project{{else}}bundle{{end}}:
{{- $isDLT := eq .is_dlt true}}
{{if $isDLT}}project{{else}}bundle{{end}}:

Please play a bit with the - here to make this a bit easier to read. The - chops a way all whitespace.

include:
- resources/*.yml
- resources/*/*.yml
{{if $isDLT}}- ./*.yml{{else}}- resources/*.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dlt template should include both

# See also https://docs.databricks.com/dev-tools/bundles/deployment-modes.html.
mode: development
default: true
{{if $isDLT}}deploy_on_run: true{{end}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would leave a blank line when false; please experiment with {{- :)

permissions:
{{if not $isDLT}}# We explicitly deploy to /Workspace/Users/{{user_name}} to make sure we only have a single copy.
root_path: /Workspace/Users/{{user_name}}/.bundle/${bundle.name}/${bundle.target}}{{end}}
{{if $isDLT}}owner: user@company.com{{else}}permissions:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep in mind that the template won't yet work if you replace the root_path with the owner as I originally suggested. The CLI would first need to support that.

So you should probably sequence this change to be later.

@alyssa-db alyssa-db force-pushed the install-dlt-feat branch 3 times, most recently from 515956f to 1da3ff0 Compare June 18, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants