-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/generate sources add database and schema (#124)
* adding database and schema property to generate source macro * add optional arguments to include database and schema properties in generate_source * updated README for new generate_source arguments * updated argument names and cleaned up spacing * cleaned up spacing * fix spacing
- Loading branch information
1 parent
e24e5dc
commit 2012ee8
Showing
6 changed files
with
53 additions
and
4 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
19 changes: 19 additions & 0 deletions
19
integration_tests/tests/test_generate_source_include_database_property.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,19 @@ | ||
|
||
{% set raw_schema = generate_schema_name('raw_data') %} | ||
|
||
{% set actual_source_yaml = codegen.generate_source(raw_schema, include_database=True) %} | ||
|
||
{% set expected_source_yaml %} | ||
version: 2 | ||
|
||
sources: | ||
- name: {{ raw_schema | trim | lower }} | ||
database: analytics | ||
tables: | ||
- name: data__a_relation | ||
- name: data__b_relation | ||
- name: data__campaign_analytics | ||
{% endset %} | ||
|
||
|
||
{{ assert_equal (actual_source_yaml | trim, expected_source_yaml | trim) }} |
19 changes: 19 additions & 0 deletions
19
integration_tests/tests/test_generate_source_include_schema_property.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,19 @@ | ||
|
||
{% set raw_schema = generate_schema_name('raw_data') %} | ||
|
||
{% set actual_source_yaml = codegen.generate_source(raw_schema, include_schema=True) %} | ||
|
||
{% set expected_source_yaml %} | ||
version: 2 | ||
|
||
sources: | ||
- name: {{ raw_schema | trim | lower }} | ||
schema: {{ raw_schema | trim | lower }} | ||
tables: | ||
- name: data__a_relation | ||
- name: data__b_relation | ||
- name: data__campaign_analytics | ||
{% 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