Skip to content

Commit

Permalink
Release 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Higgs committed May 26, 2020
1 parent a9d69f6 commit 392c34d
Show file tree
Hide file tree
Showing 40 changed files with 584 additions and 1,099 deletions.
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
### News

* We now have a slack channel, use the button below to join
* Looking to use dbtvault or Data Vault in your project? We've written a document to give you a head start.
<a href="https://www.data-vault.co.uk/using-dbtvault-in-datavault-project-download/">Download for FREE now! </a>

<p align="center">
<img src="https://user-images.githubusercontent.com/25080503/65772647-89525700-e132-11e9-80ff-12ad30a25466.png">
</p>

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


Expand Down Expand Up @@ -69,12 +63,20 @@ And run
var('src_source'), var('source')) }}
```

## Join our Slack Channel

Talk to our developers and other members of our growing community, get support and discuss anything related to dbtvault or Data Vault 2.0

[![Join our Slack](https://img.shields.io/badge/Slack-Join-yellow?style=flat&logo=slack)](https://join.slack.com/t/dbtvault/shared_invite/enQtODY5MTY3OTIyMzg2LWJlZDMyNzM4YzAzYjgzYTY0MTMzNTNjN2EyZDRjOTljYjY0NDYyYzEwMTlhODMzNGY3MmU2ODNhYWUxYmM2NjA)

## Sign up for early-bird announcements

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

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

## Starting a Data Vault project

## Contributing
[View our contribution guidelines](CONTRIBUTING.md)

Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require-dbt-version: [">=0.14.0", "<0.17.0"]

profile: 'dbtvault'

source-paths: ["models"]
source-paths: ["models", "models_test"]
analysis-paths: ["analysis"]
test-paths: ["tests"]
data-paths: ["data"]
Expand Down
53 changes: 53 additions & 0 deletions macros/internal/alias.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{#- Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-#}
{%- macro alias(source_column=none, prefix=none) -%}

{%- if source_column -%}

{%- if source_column is iterable and source_column is not string -%}

{%- if source_column['source_column'] and source_column['alias'] -%}

{%- if prefix -%}
{{prefix}}.{{ source_column['source_column'] }} AS {{ source_column['alias'] }}
{%- else -%}
{{ source_column['source_column'] }} AS {{ source_column['alias'] }}
{%- endif -%}

{%- endif -%}

{%- else -%}

{%- if prefix -%}

{{- dbtvault.prefix([source_column], prefix) -}}

{%- else -%}

{{ source_column }}

{%- endif -%}

{%- endif -%}

{%- else -%}

{%- if execute -%}

{{ exceptions.raise_compiler_error("Invalid alias configuration:\nexpected format: {source_column: 'column', alias: 'column_alias'}\ngot: " ~ source_column) }}

{%- endif -%}

{%- endif -%}

{%- endmacro -%}
12 changes: 8 additions & 4 deletions macros/internal/single.sql → macros/internal/alias_all.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-#}
{%- macro alias_all(columns, prefix) -%}

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

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

{%- endif -%}

{%- endmacro -%}
14 changes: 12 additions & 2 deletions macros/staging/from.sql → macros/internal/as_constant.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
See the License for the specific language governing permissions and
limitations under the License.
-#}
{%- macro as_constant(column_str) -%}

{% macro from(source_table) %}
{% if column_str is not none %}

FROM {{ source_table }}
{%- if column_str | first == "!" -%}

{{- return("'" ~ column_str[1:] ~ "'") -}}

{%- else -%}

{{- return(column_str) -}}

{%- endif -%}
{%- endif -%}

{%- endmacro -%}
5 changes: 5 additions & 0 deletions macros/internal/docs/internal_macros.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%- docs macro_alias -%}

.

{%- enddocs %}
10 changes: 10 additions & 0 deletions macros/internal/docs/internal_macros_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

macros:
- name: alias
description: "{{ doc('macro_alias') }}"

arguments:
- name: src_pk
type: string
description: ""
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,41 @@
limitations under the License.
-#}

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

{%- if not columns -%}
{%- if execute -%}
{{ exceptions.raise_compiler_error("Expected a list of columns, got: " ~ columns) }}
{%- endif -%}
{%- endif -%}

{%- set col_list = [] -%}

{%- if tgt_cols is iterable -%}
{%- if columns is iterable -%}

{%- for columns in tgt_cols -%}
{%- for col in columns -%}

{%- if columns is string -%}
{%- if col is string -%}

{%- set _ = col_list.append(columns) -%}
{%- set _ = col_list.append(col) -%}

{#- If a triple -#}
{%- elif columns | first is string -%}
{#- If list of lists -#}
{%- elif col is iterable and col is not string -%}

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

{#- If list of lists -#}
{%- elif columns is iterable and columns is not string -%}
{%- set _ = col_list.append(col) -%}

{%- else -%}

{%- for cols in col -%}

{%- set _ = col_list.append(cols) -%}

{%- for cols in columns -%}
{%- endfor -%}

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

{%- endfor -%}
{%- endif -%}

{%- endfor -%}
Expand Down
41 changes: 0 additions & 41 deletions macros/internal/get_src_col_list.sql

This file was deleted.

24 changes: 0 additions & 24 deletions macros/internal/hash_check.sql

This file was deleted.

41 changes: 0 additions & 41 deletions macros/internal/is_multi_source.sql

This file was deleted.

Loading

0 comments on commit 392c34d

Please sign in to comment.