-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a dbt_pii project to start on the macro
- Loading branch information
1 parent
9223729
commit 1142895
Showing
11 changed files
with
1,254 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
dbs/*.db |
This file contains 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,14 @@ | ||
# dbt pii | ||
|
||
A dbt macro which detects pii. | ||
|
||
## Getting Started | ||
|
||
To get started, run the following: | ||
|
||
``` | ||
poetry install | ||
poetry run dbt seed --profiles-dir . | ||
poetry run dbt run --profiles-dir . | ||
sqlite3 dbs/main.db 'select * from main.pii_info;' | ||
``` |
Empty file.
This file contains 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,33 @@ | ||
name: 'dbt_pii' | ||
version: '1.0.0' | ||
config-version: 2 | ||
|
||
# This setting configures which "profile" dbt uses for this project. | ||
profile: 'dbt_sqlite' | ||
|
||
# These configurations specify where dbt should look for different types of files. | ||
# The `source-paths` config, for example, states that models in this project can be | ||
# found in the "models/" directory. You probably won't need to change these! | ||
model-paths: ["models"] | ||
analysis-paths: ["analysis"] | ||
test-paths: ["tests"] | ||
seed-paths: ["seeds"] | ||
macro-paths: ["macros"] | ||
snapshot-paths: ["snapshots"] | ||
docs-paths: ["docs"] | ||
|
||
target-path: "target" # directory which will store compiled SQL files | ||
clean-targets: # directories to be removed by `dbt clean` | ||
- "target" | ||
- "dbt_modules" | ||
|
||
|
||
# Configuring models | ||
# Full documentation: https://docs.getdbt.com/docs/configuring-models | ||
|
||
# In this example config, we tell dbt to build all models in the example/ directory | ||
# as tables. These settings can be overridden in the individual model files | ||
# using the `{{ config(...) }}` macro. | ||
models: | ||
pii: | ||
+materialized: table |
This file contains 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,11 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: pii_info | ||
description: Fact table for orders including customer and cohort dimensions. | ||
columns: | ||
- name: id | ||
- name: name | ||
- name: city | ||
- name: comments | ||
- name: pii |
This file contains 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 @@ | ||
select | ||
id, | ||
name, | ||
city, | ||
comments, | ||
"pii" as pii | ||
from {{ ref('info') }} |
This file contains 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,14 @@ | ||
version: 2 | ||
|
||
sources: | ||
- name: info | ||
schema: info | ||
loader: SQLite CLI | ||
tables: | ||
- name: info | ||
description: Fact table for orders including customer and cohort dimensions. | ||
columns: | ||
- name: id | ||
- name: name | ||
- name: city | ||
- name: comments |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,17 @@ | ||
# For more information on how to configure this file, please see: | ||
# https://docs.getdbt.com/docs/profile | ||
config: | ||
send_anonymous_usage_stats: false | ||
use_colors: true | ||
|
||
dbt_sqlite: | ||
target: dev | ||
outputs: | ||
dev: | ||
type: sqlite | ||
threads: 1 | ||
database: database | ||
schema: main | ||
schemas_and_paths: | ||
main: "{{ env_var('PWD') }}/dbs/main.db" | ||
schema_directory: "{{ env_var('PWD') }}/dbs" |
This file contains 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,16 @@ | ||
[tool.poetry] | ||
name = "dbt-pii" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.10,<3.12" | ||
dbt = "^1.0.0.38.13" | ||
dbt-sqlite = "^1.5.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains 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,4 @@ | ||
id,name,city,comments | ||
1,Sowmya,New York,called him yesterday to confirm he requested to call back in 2 days | ||
2,Jill,Los Angeles,accepted the offer license number AC432223 | ||
3,Jack,Chicago,need to call him at phone number 212-555-5555 |