-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from dbt-labs/feature/tables-option-for-codegen
Feature/tables option for codegen
- Loading branch information
Showing
8 changed files
with
67 additions
and
8 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
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
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,3 @@ | ||
col_a,col_b | ||
3,c | ||
4,d |
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
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
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 @@ | ||
|
||
{% set raw_schema = generate_schema_name('raw_data') %} | ||
|
||
-- test default args | ||
{% set actual_source_yaml = codegen.generate_source(raw_schema, table_pattern='data__%', exclude='data__a_%') %} | ||
|
||
{% set expected_source_yaml %} | ||
version: 2 | ||
|
||
sources: | ||
- name: {{ raw_schema | trim }} | ||
tables: | ||
- name: data__b_relation | ||
{% endset %} | ||
|
||
|
||
{{ assert_equal (actual_source_yaml | trim, expected_source_yaml | trim) }} |
17 changes: 17 additions & 0 deletions
17
integration_tests/tests/test_generate_source_table_pattern.sql
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 @@ | ||
|
||
{% set raw_schema = generate_schema_name('raw_data') %} | ||
|
||
-- test default args | ||
{% set actual_source_yaml = codegen.generate_source(raw_schema, table_pattern='data__b_%') %} | ||
|
||
{% set expected_source_yaml %} | ||
version: 2 | ||
|
||
sources: | ||
- name: {{ raw_schema | trim }} | ||
tables: | ||
- name: data__b_relation | ||
{% endset %} | ||
|
||
|
||
{{ assert_equal (actual_source_yaml | trim, expected_source_yaml | trim) }} |
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