-
Notifications
You must be signed in to change notification settings - Fork 154
Add an experimental dbt-sql template #1059
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
Changes from all commits
4fee665
b3a5ef8
c81d139
c900cff
16f26a3
cd52c83
d85d4c4
419bd27
9030f56
45ea8db
0268c88
94ebd9a
14bc1fa
1501298
6fc5ed4
220a1ea
99f920e
af0dd6d
1099eed
33c5e91
7275310
de7bd78
8e7c6a1
18c6b70
a660efa
2f52ff1
e041148
00bf2fe
e5fb708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # dbt template | ||
|
|
||
| This folder provides a template for using dbt-core with Databricks Asset Bundles. | ||
| It leverages dbt-core for local development and relies on Databricks Asset Bundles | ||
| for deployment (either manually or with CI/CD). In production, | ||
| dbt is executed using Databricks Workflows. | ||
|
|
||
| * Learn more about the dbt and its standard project structure here: https://docs.getdbt.com/docs/build/projects. | ||
| * Learn more about Databricks Asset Bundles here: https://docs.databricks.com/en/dev-tools/bundles/index.html |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "welcome_message": "\nWelcome to the (EXPERIMENTAL) dbt template for Databricks Asset Bundles!", | ||
| "properties": { | ||
| "project_name": { | ||
| "type": "string", | ||
| "pattern": "^[A-Za-z_][A-Za-z0-9_]+$", | ||
| "pattern_match_failure_message": "Name must consist of letters, numbers, and underscores.", | ||
| "default": "dbt_project", | ||
| "description": "\nPlease provide a unique name for this project.\nproject_name", | ||
| "order": 1 | ||
| }, | ||
| "http_path": { | ||
| "type": "string", | ||
| "pattern": "^/sql/.\\../warehouses/[a-z0-9]+$", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How does this pattern work without
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand this question. There is a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or maybe you're referring to the |
||
| "pattern_match_failure_message": "Path must be of the form /sql/1.0/warehouses/<warehouse id>", | ||
| "description": " \nPlease provide the HTTP Path of the SQL warehouse you would like to use with dbt during development.\nYou can find this path by clicking on \"Connection details\" for your SQL warehouse.\nhttp_path [example: /sql/1.0/warehouses/abcdef1234567890]", | ||
| "order": 2 | ||
lennartkats-db marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
lennartkats-db marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "default_catalog": { | ||
| "type": "string", | ||
| "default": "{{default_catalog}}", | ||
| "pattern": "^\\w*$", | ||
| "pattern_match_failure_message": "Invalid catalog name.", | ||
| "description": "\nPlease provide an initial catalog{{if eq (default_catalog) \"\"}} (leave blank when not using Unity Catalog){{end}}.\ndefault_catalog", | ||
| "order": 3 | ||
| }, | ||
| "personal_schemas": { | ||
| "type": "string", | ||
| "description": "\nWould you like to use a personal schema for each user working on this project? (e.g., 'catalog.{{short_name}}')\npersonal_schemas", | ||
| "enum": [ | ||
| "yes, use a schema based on the current user name during development", | ||
| "no, use a shared schema during development" | ||
| ], | ||
| "order": 4 | ||
| }, | ||
| "shared_schema": { | ||
| "skip_prompt_if": { | ||
| "properties": { | ||
| "personal_schemas": { | ||
| "const": "yes, use a schema based on the current user name during development" | ||
| } | ||
| } | ||
| }, | ||
| "type": "string", | ||
| "default": "default", | ||
| "pattern": "^\\w+$", | ||
| "pattern_match_failure_message": "Invalid schema name.", | ||
| "description": "\nPlease provide an initial schema during development.\ndefault_schema", | ||
| "order": 5 | ||
| } | ||
| }, | ||
| "success_message": "\n📊 Your new project has been created in the '{{.project_name}}' directory!\nIf you already have dbt installed, just type 'cd {{.project_name}}; dbt init' to get started.\nRefer to the README.md file for full \"getting started\" guide and production setup instructions.\n" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| {{define "latest_lts_dbr_version" -}} | ||
| 13.3.x-scala2.12 | ||
| {{- end}} | ||
|
|
||
| {{define "latest_lts_db_connect_version_spec" -}} | ||
| >=13.3,<13.4 | ||
| {{- end}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Preamble | ||
|
|
||
| This file only template directives; it is skipped for the actual output. | ||
|
|
||
| {{skip "__preamble"}} | ||
|
|
||
| {{if eq .project_name "dbt"}} | ||
| {{fail "Project name 'dbt' is not supported"}} | ||
| {{end}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Typings for Pylance in Visual Studio Code | ||
| # see https://github.com/microsoft/pyright/blob/main/docs/builtins.md | ||
| from databricks.sdk.runtime import * |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "recommendations": [ | ||
| "redhat.vscode-yaml", | ||
| "innoverio.vscode-dbt-power-user", | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "python.analysis.stubPath": ".vscode", | ||
| "databricks.python.envFile": "${workspaceFolder}/.env", | ||
| "jupyter.interactiveWindow.cellMarker.codeRegex": "^# COMMAND ----------|^# Databricks notebook source|^(#\\s*%%|#\\s*\\<codecell\\>|#\\s*In\\[\\d*?\\]|#\\s*In\\[ \\])", | ||
| "jupyter.interactiveWindow.cellMarker.default": "# COMMAND ----------", | ||
| "python.testing.pytestArgs": [ | ||
| "." | ||
| ], | ||
| "python.testing.unittestEnabled": false, | ||
| "python.testing.pytestEnabled": true, | ||
| "python.analysis.extraPaths": ["src"], | ||
| "files.exclude": { | ||
| "**/*.egg-info": true, | ||
| "**/__pycache__": true, | ||
| ".pytest_cache": true, | ||
| }, | ||
| "python.envFile": "${workspaceFolder}/.databricks/.databricks.env", | ||
| "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python", | ||
| "sqltools.connections": [ | ||
| { | ||
| "connectionMethod": "VS Code Extension (beta)", | ||
| "catalog": "hive_metastore", | ||
| "previewLimit": 50, | ||
| "driver": "Databricks", | ||
| "name": "databricks", | ||
| "path": "{{.http_path}}" | ||
| } | ||
| ], | ||
| "sqltools.autoConnectTo": "", | ||
| "[jinja-sql]": { | ||
| "editor.defaultFormatter": "innoverio.vscode-dbt-power-user" | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.