forked from infinitelambda/dbt-tags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
133 lines (120 loc) · 4.34 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
[tool.poetry]
name = "dbt-tags"
version = "0.0.0"
description = "Tag-based masking policies management in Snowflake ❄️"
authors = ["Infinite Lambda <[email protected]>"]
readme = "README.md"
license = "Apache-2.0"
repository = "https://github.com/infinitelambda/dbt-tags"
homepage = "https://infinitelambda.com"
documentation = "https://dbt-tags.iflambda.com/latest/"
keywords = ["packaging", "dbt", "tags", "pii", "markdown", "lint"]
classifiers = [
"Topic :: dbt Package Development :: Documentation",
"Topic :: dbt Package Development :: Testing",
"Topic :: dbt Package :: Tags Management",
"Topic :: dbt Package :: Tag-based Masking Policies Management",
]
[tool.poetry.dependencies]
python = ">=3.9,<3.13"
dbt-snowflake = "^1.7.0"
[tool.poetry.dev-dependencies]
pre-commit = "^2.17.0"
poethepoet = "^0.16.4"
sqlfluff = "^3.0.0"
sqlfluff-templater-dbt = "^3.0.0"
mkdocs = "^1.5.3"
mkdocs-material = "^9.4.8"
mkdocs-minify-plugin = "^0.7.1"
mike = "^2.0.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.sqlfluff.core]
templater = "dbt"
dialect = "snowflake"
sql_file_exts = ".sql,.sql.j2,.dml,.ddl"
max_line_length = 120
[tool.sqlfluff.templater.dbt]
profile = "dbt_tags"
[tool.sqlfluff.rules]
allow_scalar = true
single_table_references = "consistent"
unquoted_identifiers_policy = "all"
[tool.sqlfluff.layout.type.comma]
line_position = "leading"
[tool.sqlfluff.indentation]
tab_space_size = 2
indent_unit = "space"
[toolsqlfluff.rules.capitalisation.keywords]
capitalisation_policy = "lower"
[toolsqlfluff.rules.capitalisation.functions]
capitalisation_policy = "lower"
[tool.sqlfluff.templater]
unwrap_wrapped_queries = true
[tool.sqlfluff.templater.jinja]
apply_dbt_builtins = true
[tool.poe.tasks]
git-hooks = { shell = "pre-commit install --install-hooks && pre-commit install --hook-type commit-msg" }
format = [
{cmd = "dbt clean"},
{cmd = "dbt deps"},
{cmd = "sqlfluff format . --dialect snowflake"},
]
lint = [
{cmd = "dbt clean"},
{cmd = "dbt deps"},
{cmd = "sqlfluff lint . --dialect snowflake"},
]
dbt-tags-verify = [
{cmd = "dbt deps --project-dir integration_tests"},
{cmd = "dbt debug --project-dir integration_tests"},
]
dbt-tags-tagging = [
{cmd = "dbt run-operation create_tags --project-dir integration_tests"},
{cmd = "dbt run-operation create_masking_policies --project-dir integration_tests"},
{cmd = "dbt run-operation apply_mps_to_tags --project-dir integration_tests"},
]
dbt-tags-test-tagging = [
{cmd = "dbt deps --project-dir integration_tests"},
{cmd = "poe dbt-tags-tagging"},
{cmd = "dbt build -s resource_type:seed --project-dir integration_tests"},
{cmd = "dbt build --exclude tag:cleanup resource_type:seed --project-dir integration_tests"},
]
dbt-tags-test-unapply-mps = [
{cmd = "poe dbt-tags-tagging"},
{cmd = "dbt run-operation unapply_mps_from_tags --project-dir integration_tests"},
{cmd = "dbt run -s verify_if_masking_policies_applied_correctly --project-dir integration_tests"},
{cmd = "dbt test -s verify_if_unapply_mps_correctly --project-dir integration_tests"},
]
dbt-tags-test-drop-tags = [
{cmd = "poe dbt-tags-tagging"},
{cmd = "dbt run-operation drop_tags --project-dir integration_tests"},
{cmd = "dbt run -s verify_if_tags_created_correctly --project-dir integration_tests --vars {'dbt_tags__tag_source_columns':false}"},
{cmd = "dbt test -s verify_if_drop_tags_correctly --project-dir integration_tests --vars {'dbt_tags__tag_source_columns':false}"},
]
dbt-tags-test = [
{cmd = "poe dbt-tags-test-tagging"},
{cmd = "poe dbt-tags-test-unapply-mps"},
{cmd = "poe dbt-tags-test-drop-tags"},
]
build-doc = [
{cmd = "dbt deps --project-dir integration_tests"},
{cmd = "dbt docs generate --select package:dbt_tags --project-dir integration_tests"},
{cmd = "mkdocs build"}
]
build-doc-and-serve = [
{cmd = "poe build-doc"},
{cmd = "mkdocs serve"}
]
git-push-github = [
{cmd = "git remote set-url origin https://github.com/infinitelambda/dbt-tags.git"},
{cmd = "git push"},
{cmd = "git remote set-url origin [email protected]:infinitelambda/bi-chapter/dbt-tags.git"}
]
git-pull-github = [
{cmd = "git remote set-url origin https://github.com/infinitelambda/dbt-tags.git"},
{cmd = "git pull"},
{cmd = "git remote set-url origin [email protected]:infinitelambda/bi-chapter/dbt-tags.git"},
{cmd = "git push"}
]