-
Notifications
You must be signed in to change notification settings - Fork 145
Prepare a new "generic" template, use "src layout" for Lakeflow template #3671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
d7fb717
Reorganize template structure
lennartkats-db b558a96
Support templates with a different template_dir
lennartkats-db 9292994
Reorganize template
lennartkats-db 1eed475
Fix readers
lennartkats-db f0a6ca1
Update templates
lennartkats-db bf6827f
Refine template
lennartkats-db e1cf153
Remove tests for now
lennartkats-db 7bb5a1e
Add changelog
lennartkats-db 705b7cc
Minor tweaks
lennartkats-db 1f17170
Refine comment
lennartkats-db 3045982
Merge branch 'main' into add-default-template
lennartkats-db 039843d
Merge remote-tracking branch 'origin/main' into add-default-template
lennartkats-db 25bd303
Fix root_path
lennartkats-db 3b2f7c1
Merge remote-tracking branch 'origin' into add-default-template
lennartkats-db e36bd95
Merge remote-tracking branch 'origin/add-default-template' into add-d…
lennartkats-db df857eb
Merge branch 'main' into add-default-template
lennartkats-db f71487f
Document limitation
lennartkats-db c62740a
Consistency tweaks
lennartkats-db a37d66f
Update
lennartkats-db 4661002
Change environment_version back to 2 in default template
lennartkats-db b16d984
Merge main into add-default-template
lennartkats-db 109f0fd
[DECO-25663] Add template_dir setting for bundle templates
lennartkats-db 5a842cb
Reorganize template structure
lennartkats-db b6dd22d
Support templates with a different template_dir
lennartkats-db 80cbe1f
Reorganize template
lennartkats-db b7f0717
Fix readers
lennartkats-db 6b72963
Update templates
lennartkats-db 90b5dd4
Refine template
lennartkats-db 3717102
Remove tests for now
lennartkats-db c1f7ce9
Add changelog
lennartkats-db 8470eda
Minor tweaks
lennartkats-db a275e8a
Refine comment
lennartkats-db 8131fc1
Fix root_path
lennartkats-db bf9d641
Document limitation
lennartkats-db 0eb01fc
Consistency tweaks
lennartkats-db ceb1fb2
Update
lennartkats-db 48e58bd
Change environment_version back to 2 in default template
lennartkats-db 80ee7ca
[DECO-25663] Add template_dir setting for bundle templates
lennartkats-db 6b61ad1
Merge remote-tracking branch 'origin/main' into add-default-template
lennartkats-db 9a13f5e
Merge remote-tracking branch 'origin/main' into add-default-template
lennartkats-db 5d261bc
Fix NEXT_CHANGELOG.md
lennartkats-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ce/bundle/templates/lakeflow-pipelines/python/output/my_lakeflow_pipelines/pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [project] | ||
| name = "my_lakeflow_pipelines" | ||
| version = "0.0.1" | ||
| authors = [{ name = "[USERNAME]" }] | ||
| requires-python = ">=3.10,<=3.13" | ||
| dependencies = [ | ||
| # Any dependencies for jobs and pipelines in this project can be added here | ||
| # See also https://docs.databricks.com/dev-tools/bundles/library-dependencies | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest", | ||
| "databricks-dlt", | ||
| "databricks-connect>=15.4,<15.5", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| main = "my_lakeflow_pipelines.main:main" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.black] | ||
| line-length = 125 |
21 changes: 21 additions & 0 deletions
21
...pelines/python/output/my_lakeflow_pipelines/resources/lakeflow_pipelines_etl.pipeline.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # The main pipeline for my_lakeflow_pipelines | ||
|
|
||
| resources: | ||
| pipelines: | ||
| lakeflow_pipelines_etl: | ||
| name: lakeflow_pipelines_etl | ||
| ## Catalog is required for serverless compute | ||
| catalog: ${var.catalog} | ||
| schema: ${var.schema} | ||
| serverless: true | ||
| root_path: "." | ||
lennartkats-db marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| libraries: | ||
| - glob: | ||
| include: ../src/lakeflow_pipelines_etl/transformations/** | ||
|
|
||
| environment: | ||
| dependencies: | ||
| # We include every dependency defined by pyproject.toml by defining an editable environment | ||
| # that points to the folder where pyproject.toml is deployed. | ||
| - --editable ${workspace.file_path} | ||
15 changes: 0 additions & 15 deletions
15
...y_lakeflow_pipelines/resources/lakeflow_pipelines_etl/lakeflow_pipelines_etl.pipeline.yml
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
.../lakeflow-pipelines/python/output/my_lakeflow_pipelines/src/my_lakeflow_pipelines/main.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import argparse | ||
| from databricks.sdk.runtime import spark | ||
| from my_lakeflow_pipelines import taxis | ||
|
|
||
|
|
||
| def main(): | ||
| # Process command-line arguments | ||
| parser = argparse.ArgumentParser(description="Databricks job with catalog and schema parameters") | ||
| parser.add_argument("--catalog", required=True) | ||
| parser.add_argument("--schema", required=True) | ||
| args = parser.parse_args() | ||
|
|
||
| # Set the default catalog and schema | ||
| spark.sql(f"USE CATALOG {args.catalog}") | ||
| spark.sql(f"USE SCHEMA {args.schema}") | ||
|
|
||
| # Example: just find all taxis from a sample catalog | ||
| taxis.find_all_taxis().show(5) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
...tance/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [project] | ||
| name = "my_lakeflow_pipelines" | ||
| version = "0.0.1" | ||
| authors = [{ name = "[USERNAME]" }] | ||
| requires-python = ">=3.10,<=3.13" | ||
| dependencies = [ | ||
| # Any dependencies for jobs and pipelines in this project can be added here | ||
| # See also https://docs.databricks.com/dev-tools/bundles/library-dependencies | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest", | ||
| "databricks-dlt", | ||
| "databricks-connect>=15.4,<15.5", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| main = "my_lakeflow_pipelines.main:main" | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.black] | ||
| line-length = 125 |
1 change: 0 additions & 1 deletion
1
...e/bundle/templates/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/resources/.gitkeep
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...-pipelines/sql/output/my_lakeflow_pipelines/resources/lakeflow_pipelines_etl.pipeline.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # The main pipeline for my_lakeflow_pipelines | ||
|
|
||
| resources: | ||
| pipelines: | ||
| lakeflow_pipelines_etl: | ||
| name: lakeflow_pipelines_etl | ||
| ## Catalog is required for serverless compute | ||
| catalog: ${var.catalog} | ||
| schema: ${var.schema} | ||
| serverless: true | ||
| root_path: "." | ||
|
|
||
| libraries: | ||
| - glob: | ||
| include: ../src/lakeflow_pipelines_etl/transformations/** | ||
|
|
||
| environment: | ||
| dependencies: | ||
| # We include every dependency defined by pyproject.toml by defining an editable environment | ||
| # that points to the folder where pyproject.toml is deployed. | ||
| - --editable ${workspace.file_path} |
15 changes: 0 additions & 15 deletions
15
...y_lakeflow_pipelines/resources/lakeflow_pipelines_etl/lakeflow_pipelines_etl.pipeline.yml
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
22 changes: 22 additions & 0 deletions
22
...tes/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/src/my_lakeflow_pipelines/main.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import argparse | ||
| from databricks.sdk.runtime import spark | ||
| from my_lakeflow_pipelines import taxis | ||
|
|
||
|
|
||
| def main(): | ||
| # Process command-line arguments | ||
| parser = argparse.ArgumentParser(description="Databricks job with catalog and schema parameters") | ||
| parser.add_argument("--catalog", required=True) | ||
| parser.add_argument("--schema", required=True) | ||
| args = parser.parse_args() | ||
|
|
||
| # Set the default catalog and schema | ||
| spark.sql(f"USE CATALOG {args.catalog}") | ||
| spark.sql(f"USE SCHEMA {args.schema}") | ||
|
|
||
| # Example: just find all taxis from a sample catalog | ||
| taxis.find_all_taxis().show(5) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
7 changes: 7 additions & 0 deletions
7
...es/lakeflow-pipelines/sql/output/my_lakeflow_pipelines/src/my_lakeflow_pipelines/taxis.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from databricks.sdk.runtime import spark | ||
| from pyspark.sql import DataFrame | ||
|
|
||
|
|
||
| def find_all_taxis() -> DataFrame: | ||
| """Find all taxi data.""" | ||
| return spark.read.table("samples.nyctaxi.trips") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.