Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
codespace compatible
  • Loading branch information
dataders committed Sep 16, 2022
commit a1d3748993b07c3b6cbb1ab0cbcb618362671ee7
94 changes: 94 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6
{
"name": "dbt",
"dockerFile" : "Dockerfile",
"settings": {
"terminal.integrated.defaultProfile.linux#": "/bin/sh",
"files.associations": {
"*.sql": "jinja-sql",
"*.sqlfluff": "ini",
"*.yml": "yaml",
"**/target/**": ""
},
"sql.linter.executablePath": "/usr/local/bin/sqlfluff",
"sql.format.enable": true,
"sql.linter.run": "onType",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/__pycache__": true
},
"findrelated.workspaceRulesets": [
{
"name": "sql",
"rules": [
{
"pattern": "^(.*/)?models/(.*/)?(.+\\.sql)$",
"locators": [
"**/compiled/**/$3"
]
},
{
"pattern": "^(.*/)?compiled/(.*/)?(.+\\.sql)$",
"locators": [
"**/run/**/$3"
]
},
{
"pattern": "^(.*/)?run/(.*/)?(.+\\.sql)$",
"locators": [
"**/models/**/$3"
]
}
]
}
],
"findrelated.applyRulesets": [
"sql"
],
"findrelated.applyWorkspaceRulesets": [
"sql"
],
"workbench.editor.highlightModifiedTabs": true,
"workbench.editor.labelFormat": "medium",
"workbench.editor.revealIfOpen": true,
"editor.rulers": [
99
],
"yaml.schemas": {
"https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/dbt_yml_files.json": [
"/*.yml",
"!profiles.yml",
"!dbt_project.yml",
"!packages.yml",
"!selectors.yml",
"!profile_template.yml"
],
"https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/dbt_project.json": [
"dbt_project.yml"
],
"https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/selectors.json": [
"selectors.yml"
],
"https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/packages.json": [
"packages.yml"
]
}
},
"extensions": [
"bastienboutonnet.vscode-dbt",
"dorzey.vscode-sqlfluff",
"editorconfig.editorconfig",
"amodio.find-related",
"ms-azuretools.vscode-docker",
"ms-python.python",
"visualstudioexptteam.vscodeintellicode",
"samuelcolvin.jinjahtml",
"redhat.vscode-yaml"
],

"remoteUser": "vscode"
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
target/
dbt_packages/
logs/
**/.DS_Store
.user.yml
venv/
env/
3 changes: 3 additions & 0 deletions .sqlfluff
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[sqlfluff]

dialect = snowflake
16 changes: 16 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"innoverio.vscode-dbt-power-user",
"mechatroner.rainbow-csv",
"yzhang.markdown-all-in-one",
"redhat.vscode-yaml"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9

ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi

RUN pwd
RUN ls
COPY requirements.txt /tmp/
RUN pip3 install --upgrade pip
RUN pip3 install --requirement /tmp/requirements.txt

ENV DBT_PROFILES_DIR=/workspaces/new-python-wrench-demo
29 changes: 29 additions & 0 deletions profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
config:
partial_parse: true
variables:
snow-dev: &snow-dev
type: snowflake
account: '{{ env_var("DBT_SNOW_DEV_ACCOUNT") }}'
warehouse: '{{ env_var("DBT_SNOW_DEV_WH") }}' # transforming
database: '{{ env_var("DBT_SNOW_DEV_DB") }}' # jaffle_shop
schema: '{{ env_var("DBT_SNOW_SCH") }}' # ajs
user: '{{ env_var("DBT_SNOW_USER") }}' # ANDERS.SWANSON
role: transformer
authenticator: externalbrowser
threads: 10

snow-prd: &snow-prd
type: snowflake
account: '{{ env_var("DBT_SNOW_PRD_ACCOUNT") }}'
warehouse: '{{ env_var("DBT_SNOW_PRD_WH") }}' # transforming
database: '{{ env_var("DBT_SNOW_PRD_DB") }}' # jaffle_shop
schema: '{{ env_var("DBT_SNOW_SCH") }}' # ajs
user: '{{ env_var("DBT_SNOW_USER") }}' # ANDERS.SWANSON
role: transformer
authenticator: externalbrowser
threads: 10
python_wrench:
target: dev
outputs:
dev: *snow-dev
prd: *snow-prd
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dbt-snowflake==1.3.0b2
# extra features
sqlfluff~=1.2.1