Skip to content

Commit 392c34d

Browse files
author
Alex Higgs
committed
Release 0.6
1 parent a9d69f6 commit 392c34d

40 files changed

+584
-1099
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-30
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

-20
This file was deleted.

.gitignore

-1
This file was deleted.

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
### News
2-
3-
* We now have a slack channel, use the button below to join
4-
* Looking to use dbtvault or Data Vault in your project? We've written a document to give you a head start.
5-
<a href="https://www.data-vault.co.uk/using-dbtvault-in-datavault-project-download/">Download for FREE now! </a>
6-
71
<p align="center">
82
<img src="https://user-images.githubusercontent.com/25080503/65772647-89525700-e132-11e9-80ff-12ad30a25466.png">
93
</p>
104

11-
[![Documentation Status](https://readthedocs.org/projects/dbtvault/badge/?version=latest)](https://dbtvault.readthedocs.io/en/latest/?badge=latest)
5+
[![Documentation Status](https://readthedocs.org/projects/dbtvault/badge/?version=stable)](https://dbtvault.readthedocs.io/en/latest/?badge=stable)
126
[![Join our Slack](https://img.shields.io/badge/Slack-Join-yellow?style=flat&logo=slack)](https://join.slack.com/t/dbtvault/shared_invite/enQtODY5MTY3OTIyMzg2LWJlZDMyNzM4YzAzYjgzYTY0MTMzNTNjN2EyZDRjOTljYjY0NDYyYzEwMTlhODMzNGY3MmU2ODNhYWUxYmM2NjA)
137

148

@@ -69,12 +63,20 @@ And run
6963
var('src_source'), var('source')) }}
7064
```
7165

66+
## Join our Slack Channel
67+
68+
Talk to our developers and other members of our growing community, get support and discuss anything related to dbtvault or Data Vault 2.0
69+
70+
[![Join our Slack](https://img.shields.io/badge/Slack-Join-yellow?style=flat&logo=slack)](https://join.slack.com/t/dbtvault/shared_invite/enQtODY5MTY3OTIyMzg2LWJlZDMyNzM4YzAzYjgzYTY0MTMzNTNjN2EyZDRjOTljYjY0NDYyYzEwMTlhODMzNGY3MmU2ODNhYWUxYmM2NjA)
71+
7272
## Sign up for early-bird announcements
7373

7474
[![Sign up](https://img.shields.io/badge/Email-Sign--up-blue)](https://www.data-vault.co.uk/dbtvault/)
7575

7676
Get notified of new features and new releases before anyone else!
7777

78+
## Starting a Data Vault project
79+
7880
## Contributing
7981
[View our contribution guidelines](CONTRIBUTING.md)
8082

dbt_project.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require-dbt-version: [">=0.14.0", "<0.17.0"]
44

55
profile: 'dbtvault'
66

7-
source-paths: ["models"]
7+
source-paths: ["models", "models_test"]
88
analysis-paths: ["analysis"]
99
test-paths: ["tests"]
1010
data-paths: ["data"]

macros/internal/alias.sql

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{#- Licensed under the Apache License, Version 2.0 (the "License");
2+
you may not use this file except in compliance with the License.
3+
You may obtain a copy of the License at
4+
5+
http://www.apache.org/licenses/LICENSE-2.0
6+
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
-#}
13+
{%- macro alias(source_column=none, prefix=none) -%}
14+
15+
{%- if source_column -%}
16+
17+
{%- if source_column is iterable and source_column is not string -%}
18+
19+
{%- if source_column['source_column'] and source_column['alias'] -%}
20+
21+
{%- if prefix -%}
22+
{{prefix}}.{{ source_column['source_column'] }} AS {{ source_column['alias'] }}
23+
{%- else -%}
24+
{{ source_column['source_column'] }} AS {{ source_column['alias'] }}
25+
{%- endif -%}
26+
27+
{%- endif -%}
28+
29+
{%- else -%}
30+
31+
{%- if prefix -%}
32+
33+
{{- dbtvault.prefix([source_column], prefix) -}}
34+
35+
{%- else -%}
36+
37+
{{ source_column }}
38+
39+
{%- endif -%}
40+
41+
{%- endif -%}
42+
43+
{%- else -%}
44+
45+
{%- if execute -%}
46+
47+
{{ exceptions.raise_compiler_error("Invalid alias configuration:\nexpected format: {source_column: 'column', alias: 'column_alias'}\ngot: " ~ source_column) }}
48+
49+
{%- endif -%}
50+
51+
{%- endif -%}
52+
53+
{%- endmacro -%}

macros/internal/single.sql macros/internal/alias_all.sql

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
See the License for the specific language governing permissions and
1111
limitations under the License.
1212
-#}
13+
{%- macro alias_all(columns, prefix) -%}
1314

14-
{%- macro single(src_pk, src_nk, src_ldts, src_source,
15-
source, letter='a') -%}
15+
{%- if columns is iterable and columns is not string -%}
1616

17-
SELECT {{ dbtvault.prefix([src_pk, src_nk, src_ldts, src_source], letter) }}
18-
FROM {{ source }} AS {{ letter }}
17+
{%- for column in columns -%}
18+
{{ dbtvault.alias(column, prefix) }}
19+
{%- if not loop.last -%} , {% endif -%}
20+
{%- endfor -%}
21+
22+
{%- endif -%}
1923

2024
{%- endmacro -%}

macros/staging/from.sql macros/internal/as_constant.sql

+12-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@
1010
See the License for the specific language governing permissions and
1111
limitations under the License.
1212
-#}
13+
{%- macro as_constant(column_str) -%}
1314

14-
{% macro from(source_table) %}
15+
{% if column_str is not none %}
1516

16-
FROM {{ source_table }}
17+
{%- if column_str | first == "!" -%}
18+
19+
{{- return("'" ~ column_str[1:] ~ "'") -}}
20+
21+
{%- else -%}
22+
23+
{{- return(column_str) -}}
24+
25+
{%- endif -%}
26+
{%- endif -%}
1727

1828
{%- endmacro -%}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{%- docs macro_alias -%}
2+
3+
.
4+
5+
{%- enddocs %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
3+
macros:
4+
- name: alias
5+
description: "{{ doc('macro_alias') }}"
6+
7+
arguments:
8+
- name: src_pk
9+
type: string
10+
description: ""

macros/internal_deprecated/get_col_list.sql macros/internal/expand_column_list.sql

+22-13
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,41 @@
1111
limitations under the License.
1212
-#}
1313

14-
{%- macro get_col_list(tgt_cols) -%}
14+
{%- macro expand_column_list(columns=none) -%}
1515

16+
{%- if not columns -%}
17+
{%- if execute -%}
18+
{{ exceptions.raise_compiler_error("Expected a list of columns, got: " ~ columns) }}
19+
{%- endif -%}
20+
{%- endif -%}
1621

1722
{%- set col_list = [] -%}
1823

19-
{%- if tgt_cols is iterable -%}
24+
{%- if columns is iterable -%}
2025

21-
{%- for columns in tgt_cols -%}
26+
{%- for col in columns -%}
2227

23-
{%- if columns is string -%}
28+
{%- if col is string -%}
2429

25-
{%- set _ = col_list.append(columns) -%}
30+
{%- set _ = col_list.append(col) -%}
2631

27-
{#- If a triple -#}
28-
{%- elif columns | first is string -%}
32+
{#- If list of lists -#}
33+
{%- elif col is iterable and col is not string -%}
2934

30-
{%- set _ = col_list.append(columns|last) -%}
35+
{%- if col is mapping -%}
3136

32-
{#- If list of lists -#}
33-
{%- elif columns is iterable and columns is not string -%}
37+
{%- set _ = col_list.append(col) -%}
38+
39+
{%- else -%}
40+
41+
{%- for cols in col -%}
42+
43+
{%- set _ = col_list.append(cols) -%}
3444

35-
{%- for cols in columns -%}
45+
{%- endfor -%}
3646

37-
{%- set _ = col_list.append(cols|last) -%}
47+
{%- endif -%}
3848

39-
{%- endfor -%}
4049
{%- endif -%}
4150

4251
{%- endfor -%}

macros/internal/get_src_col_list.sql

-41
This file was deleted.

macros/internal/hash_check.sql

-24
This file was deleted.

macros/internal/is_multi_source.sql

-41
This file was deleted.

0 commit comments

Comments
 (0)