From f69e2ee6051df67a752ba65fd4e5d8f5c95609f6 Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Fri, 16 Sep 2022 13:03:29 -0400 Subject: [PATCH 01/24] add materialize_as_view parameter to generate_base_model --- macros/generate_base_model.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 2016de6..a3f9541 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -1,10 +1,13 @@ -{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False) %} +{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialize_as_view=False) %} {%- set source_relation = source(source_name, table_name) -%} {%- set columns = adapter.get_columns_in_relation(source_relation) -%} {% set column_names=columns | map(attribute='name') %} {% set base_model_sql %} +{%- if materialize_as_view -%} +{{ "{{ config(materialized='view') }}" }} +{%- endif %} with source as ( select * from {% raw %}{{ source({% endraw %}'{{ source_name }}', '{{ table_name }}'{% raw %}) }}{% endraw %} From 24a301d6176d3457184346630d70522c1ca0169b Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Fri, 16 Sep 2022 13:05:47 -0400 Subject: [PATCH 02/24] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d31f437..ade476e 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ model. * `table_name` (required): The source table you wish to generate base model SQL for. * `leading_commas` (optional, default=False): Whether you want your commas to be leading (vs trailing). * `case_sensitive_cols ` (optional, default=False): Whether your source table has case sensitive column names. If true, keeps the case of the column names from the source. +* `materialize_as_view` (optional, default=False): Whether you want the base model to be a view. ### Usage: @@ -88,7 +89,8 @@ model. ``` {{ codegen.generate_base_model( source_name='raw_jaffle_shop', - table_name='customers' + table_name='customers', + materialize_as_view=True ) }} ``` From a9bdf626aac9a82ce9eb9f76b6908da66a33aadf Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 14:36:52 -0400 Subject: [PATCH 03/24] change parameter to pass materialization type --- macros/generate_base_model.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index a3f9541..775612b 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -1,13 +1,13 @@ -{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialize_as_view=False) %} +{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialization='table') %} {%- set source_relation = source(source_name, table_name) -%} {%- set columns = adapter.get_columns_in_relation(source_relation) -%} {% set column_names=columns | map(attribute='name') %} {% set base_model_sql %} -{%- if materialize_as_view -%} -{{ "{{ config(materialized='view') }}" }} -{%- endif %} + +{{ "{{ config(materialized='"+materialization+"' }}" }} + with source as ( select * from {% raw %}{{ source({% endraw %}'{{ source_name }}', '{{ table_name }}'{% raw %}) }}{% endraw %} From 274a6d7f6e69ed8f175390cad109036c04170e3d Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 14:37:50 -0400 Subject: [PATCH 04/24] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ade476e..3fb004a 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ model. * `table_name` (required): The source table you wish to generate base model SQL for. * `leading_commas` (optional, default=False): Whether you want your commas to be leading (vs trailing). * `case_sensitive_cols ` (optional, default=False): Whether your source table has case sensitive column names. If true, keeps the case of the column names from the source. -* `materialize_as_view` (optional, default=False): Whether you want the base model to be a view. +* `materialization` (optional, default='table'): Set materialization to table or view. ### Usage: @@ -90,7 +90,7 @@ model. {{ codegen.generate_base_model( source_name='raw_jaffle_shop', table_name='customers', - materialize_as_view=True + materialization='table' ) }} ``` From cfe3c14fa575fffc38a05483d26cb56793de648b Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 16:46:47 -0400 Subject: [PATCH 05/24] Update test_generate_base_models.sql --- integration_tests/tests/test_generate_base_models.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/tests/test_generate_base_models.sql b/integration_tests/tests/test_generate_base_models.sql index dce88e4..a37719e 100644 --- a/integration_tests/tests/test_generate_base_models.sql +++ b/integration_tests/tests/test_generate_base_models.sql @@ -6,6 +6,8 @@ %} {% set expected_base_model %} +{{ "{{ config(materialized='table' }}" }} + with source as ( select * from {%raw%}{{ source('codegen_integration_tests__data_source_schema', 'codegen_integration_tests__data_source_table') }}{%endraw%} From a183abcb06f271b9ef150d6c615ba6fcf500db9d Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 16:59:33 -0400 Subject: [PATCH 06/24] Update test_generate_base_models_all_args.sql --- .../tests/test_generate_base_models_all_args.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 7a50040..e6e13a7 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -3,11 +3,14 @@ source_name='codegen_integration_tests__data_source_schema', table_name='codegen_integration_tests__data_source_table_case_sensitive', leading_commas=True, - case_sensitive_cols=True + case_sensitive_cols=True, + materialization='view' ) %} {% set expected_base_model %} +{{ "{{ config(materialized='"+materialization+"' }}" }} + with source as ( select * from {%raw%}{{ source('codegen_integration_tests__data_source_schema', 'codegen_integration_tests__data_source_table_case_sensitive') }}{%endraw%} From 83e87200dad63bbb0726f16c093082cb896655e5 Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 16:59:58 -0400 Subject: [PATCH 07/24] Update test_generate_base_models_case_sensitive.sql --- .../tests/test_generate_base_models_case_sensitive.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 1725f3d..33b00db 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -6,6 +6,8 @@ %} {% set expected_base_model %} +{{ "{{ config(materialized='table' }}" }} + with source as ( select * from {%raw%}{{ source('codegen_integration_tests__data_source_schema', 'codegen_integration_tests__data_source_table_case_sensitive') }}{%endraw%} From 19f49a2b3a34c7f6e03a4fc7e73e34f988481bbd Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 17:01:05 -0400 Subject: [PATCH 08/24] Update test_generate_base_models_leading.sql --- integration_tests/tests/test_generate_base_models_leading.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/tests/test_generate_base_models_leading.sql b/integration_tests/tests/test_generate_base_models_leading.sql index 89b19cb..e07aaea 100644 --- a/integration_tests/tests/test_generate_base_models_leading.sql +++ b/integration_tests/tests/test_generate_base_models_leading.sql @@ -7,6 +7,8 @@ %} {% set expected_base_model %} +{{ "{{ config(materialized='table' }}" }} + with source as ( select * from {%raw%}{{ source('codegen_integration_tests__data_source_schema', 'codegen_integration_tests__data_source_table') }}{%endraw%} From d451b27313955a7088215ff81d5518263cbba34c Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Thu, 22 Sep 2022 17:09:37 -0400 Subject: [PATCH 09/24] Update test_generate_base_models_all_args.sql --- integration_tests/tests/test_generate_base_models_all_args.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index e6e13a7..9f7053d 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -9,7 +9,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='"+materialization+"' }}" }} +{{ "{{ config(materialized='view' }}" }} with source as ( From 312f3a68e70a1889eb8391eae8091da9ae711196 Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Fri, 23 Sep 2022 11:38:26 -0400 Subject: [PATCH 10/24] Update generate_base_model.sql --- macros/generate_base_model.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 775612b..d19a4ef 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -6,7 +6,7 @@ {% set column_names=columns | map(attribute='name') %} {% set base_model_sql %} -{{ "{{ config(materialized='"+materialization+"' }}" }} +{{ "{{ config(materialized='"+materialization+"') }}" }} with source as ( From a68bb070c7e5a8f78b90cac8249df4b1df1fb114 Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Tue, 8 Nov 2022 11:38:57 -0500 Subject: [PATCH 11/24] Update test_generate_base_models_all_args.sql --- .../tests/test_generate_base_models_all_args.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 9f7053d..9da5580 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -4,12 +4,12 @@ table_name='codegen_integration_tests__data_source_table_case_sensitive', leading_commas=True, case_sensitive_cols=True, - materialization='view' + materialization='table' ) %} {% set expected_base_model %} -{{ "{{ config(materialized='view' }}" }} +{{ "{{ config(materialized='table' }}" }} with source as ( From 27415bd5702462ea637f2ffafb64e8ff438545a9 Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 8 Nov 2022 12:10:46 -0500 Subject: [PATCH 12/24] fix test typos --- integration_tests/tests/test_generate_base_models.sql | 2 +- integration_tests/tests/test_generate_base_models_all_args.sql | 2 +- .../tests/test_generate_base_models_case_sensitive.sql | 2 +- integration_tests/tests/test_generate_base_models_leading.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/tests/test_generate_base_models.sql b/integration_tests/tests/test_generate_base_models.sql index a37719e..43148e6 100644 --- a/integration_tests/tests/test_generate_base_models.sql +++ b/integration_tests/tests/test_generate_base_models.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table' }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 9da5580..211afae 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -9,7 +9,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table' }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 33b00db..2b384f0 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table' }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_leading.sql b/integration_tests/tests/test_generate_base_models_leading.sql index e07aaea..225e837 100644 --- a/integration_tests/tests/test_generate_base_models_leading.sql +++ b/integration_tests/tests/test_generate_base_models_leading.sql @@ -7,7 +7,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table' }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( From 11e957e24c362437c2e77c75a0d859677fdde1fa Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Tue, 22 Nov 2022 10:14:43 -0500 Subject: [PATCH 13/24] Update README.md Co-authored-by: Joel Labes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fb004a..19aff17 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ model. * `table_name` (required): The source table you wish to generate base model SQL for. * `leading_commas` (optional, default=False): Whether you want your commas to be leading (vs trailing). * `case_sensitive_cols ` (optional, default=False): Whether your source table has case sensitive column names. If true, keeps the case of the column names from the source. -* `materialization` (optional, default='table'): Set materialization to table or view. +* `materialized` (optional, default=None): Set materialization style (e.g. table, view, incremental) inside of the model's `config` block. If not set, materialization style will be controlled by `dbt_project.yml` ### Usage: From cb1d0d9930bfab57b1fcc483e856b89e6eb8d73a Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 10:21:26 -0500 Subject: [PATCH 14/24] materialized parameter default to None (Table) --- macros/generate_base_model.sql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index d19a4ef..03fb101 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -1,4 +1,4 @@ -{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialization='table') %} +{% macro generate_base_model(source_name, table_name, leading_commas=False, case_sensitive_cols=False, materialized=None) %} {%- set source_relation = source(source_name, table_name) -%} @@ -6,7 +6,11 @@ {% set column_names=columns | map(attribute='name') %} {% set base_model_sql %} -{{ "{{ config(materialized='"+materialization+"') }}" }} +{%- if materialized is not None -%} + {{ "{{ config(materialized='" ~ materialized ~ "') }}" }} +{%- else -%} + {{ "{{ config(materialized='table') }}" }} +{%- endif -%} with source as ( From 457303836a3704a323532d74c35149f62fcf0713 Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 10:25:15 -0500 Subject: [PATCH 15/24] README edit, change tests to use None --- README.md | 2 +- integration_tests/tests/test_generate_base_models.sql | 2 +- .../tests/test_generate_base_models_all_args.sql | 4 ++-- .../tests/test_generate_base_models_case_sensitive.sql | 2 +- integration_tests/tests/test_generate_base_models_leading.sql | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19aff17..ca4eb37 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ model. {{ codegen.generate_base_model( source_name='raw_jaffle_shop', table_name='customers', - materialization='table' + materialized='table' ) }} ``` diff --git a/integration_tests/tests/test_generate_base_models.sql b/integration_tests/tests/test_generate_base_models.sql index 43148e6..9b7c322 100644 --- a/integration_tests/tests/test_generate_base_models.sql +++ b/integration_tests/tests/test_generate_base_models.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} +{{ "{{ config(materialized=None) }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 211afae..d6e3049 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -4,12 +4,12 @@ table_name='codegen_integration_tests__data_source_table_case_sensitive', leading_commas=True, case_sensitive_cols=True, - materialization='table' + materialized=None ) %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} +{{ "{{ config(materialized=None) }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 2b384f0..8d7bb06 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} +{{ "{{ config(materialized=None) }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_leading.sql b/integration_tests/tests/test_generate_base_models_leading.sql index 225e837..6a6724f 100644 --- a/integration_tests/tests/test_generate_base_models_leading.sql +++ b/integration_tests/tests/test_generate_base_models_leading.sql @@ -7,7 +7,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} +{{ "{{ config(materialized=None) }}" }} with source as ( From 7100f277440b601ee023183fd6d6bb2a9c8bdc7d Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 10:51:56 -0500 Subject: [PATCH 16/24] change None to none --- macros/generate_base_model.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 03fb101..d48066c 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -6,7 +6,7 @@ {% set column_names=columns | map(attribute='name') %} {% set base_model_sql %} -{%- if materialized is not None -%} +{%- if materialized is not none -%} {{ "{{ config(materialized='" ~ materialized ~ "') }}" }} {%- else -%} {{ "{{ config(materialized='table') }}" }} From 3a4f1772aabd9a4cce93b03cdf872a7e3720b0c8 Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 11:02:58 -0500 Subject: [PATCH 17/24] fix tests --- integration_tests/tests/test_generate_base_models.sql | 2 +- integration_tests/tests/test_generate_base_models_all_args.sql | 2 +- .../tests/test_generate_base_models_case_sensitive.sql | 2 +- integration_tests/tests/test_generate_base_models_leading.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/integration_tests/tests/test_generate_base_models.sql b/integration_tests/tests/test_generate_base_models.sql index 9b7c322..43148e6 100644 --- a/integration_tests/tests/test_generate_base_models.sql +++ b/integration_tests/tests/test_generate_base_models.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized=None) }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index d6e3049..8eb2936 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -9,7 +9,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized=None) }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 8d7bb06..2b384f0 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -6,7 +6,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized=None) }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( diff --git a/integration_tests/tests/test_generate_base_models_leading.sql b/integration_tests/tests/test_generate_base_models_leading.sql index 6a6724f..225e837 100644 --- a/integration_tests/tests/test_generate_base_models_leading.sql +++ b/integration_tests/tests/test_generate_base_models_leading.sql @@ -7,7 +7,7 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized=None) }}" }} +{{ "{{ config(materialized='table') }}" }} with source as ( From 42390c04bb98b102c4e8b8e927d9387b20323193 Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 11:17:41 -0500 Subject: [PATCH 18/24] change test to force CI --- integration_tests/tests/test_generate_base_models_all_args.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models_all_args.sql b/integration_tests/tests/test_generate_base_models_all_args.sql index 8eb2936..5a0b21e 100644 --- a/integration_tests/tests/test_generate_base_models_all_args.sql +++ b/integration_tests/tests/test_generate_base_models_all_args.sql @@ -4,7 +4,7 @@ table_name='codegen_integration_tests__data_source_table_case_sensitive', leading_commas=True, case_sensitive_cols=True, - materialized=None + materialized='table' ) %} From 1af862eed312167a8057d1d7617bf82baccbd75a Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 11:21:02 -0500 Subject: [PATCH 19/24] sigh whitespace --- macros/generate_base_model.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index d48066c..291cbd6 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -10,7 +10,7 @@ {{ "{{ config(materialized='" ~ materialized ~ "') }}" }} {%- else -%} {{ "{{ config(materialized='table') }}" }} -{%- endif -%} +{% endif %} with source as ( From 22902bd696d51bb3e8b3088ee4c330691614fb48 Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Tue, 22 Nov 2022 11:24:05 -0500 Subject: [PATCH 20/24] one less newline --- macros/generate_base_model.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 291cbd6..5e155fa 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -10,7 +10,7 @@ {{ "{{ config(materialized='" ~ materialized ~ "') }}" }} {%- else -%} {{ "{{ config(materialized='table') }}" }} -{% endif %} +{%- endif %} with source as ( From 2a9412359337ac9bd7ec8f1ab80feb898106fe0d Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Wed, 23 Nov 2022 15:49:25 -0500 Subject: [PATCH 21/24] Update integration_tests/tests/test_generate_base_models_case_sensitive.sql Co-authored-by: Joel Labes --- .../tests/test_generate_base_models_case_sensitive.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models_case_sensitive.sql b/integration_tests/tests/test_generate_base_models_case_sensitive.sql index 2b384f0..2fd3123 100644 --- a/integration_tests/tests/test_generate_base_models_case_sensitive.sql +++ b/integration_tests/tests/test_generate_base_models_case_sensitive.sql @@ -6,7 +6,6 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} with source as ( From 1143a83855d509b577524d0f785853f09dfafe70 Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Wed, 23 Nov 2022 15:49:35 -0500 Subject: [PATCH 22/24] Update macros/generate_base_model.sql Co-authored-by: Joel Labes --- macros/generate_base_model.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/macros/generate_base_model.sql b/macros/generate_base_model.sql index 5e155fa..bc6129a 100644 --- a/macros/generate_base_model.sql +++ b/macros/generate_base_model.sql @@ -8,8 +8,6 @@ {%- if materialized is not none -%} {{ "{{ config(materialized='" ~ materialized ~ "') }}" }} -{%- else -%} - {{ "{{ config(materialized='table') }}" }} {%- endif %} with source as ( From 05cab3a66e6a3e4cd18d27f46407871e71e7dbed Mon Sep 17 00:00:00 2001 From: WW Henderson Date: Wed, 23 Nov 2022 15:49:42 -0500 Subject: [PATCH 23/24] Update integration_tests/tests/test_generate_base_models_leading.sql Co-authored-by: Joel Labes --- integration_tests/tests/test_generate_base_models_leading.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models_leading.sql b/integration_tests/tests/test_generate_base_models_leading.sql index 225e837..2a43a90 100644 --- a/integration_tests/tests/test_generate_base_models_leading.sql +++ b/integration_tests/tests/test_generate_base_models_leading.sql @@ -7,7 +7,6 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} with source as ( From fd0830f0329fb430429dd693ae7acccae5d4dbba Mon Sep 17 00:00:00 2001 From: Dave Lyons Date: Wed, 23 Nov 2022 16:26:41 -0500 Subject: [PATCH 24/24] remove config from test_generate_base_models --- integration_tests/tests/test_generate_base_models.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/integration_tests/tests/test_generate_base_models.sql b/integration_tests/tests/test_generate_base_models.sql index 43148e6..1149ddb 100644 --- a/integration_tests/tests/test_generate_base_models.sql +++ b/integration_tests/tests/test_generate_base_models.sql @@ -6,7 +6,6 @@ %} {% set expected_base_model %} -{{ "{{ config(materialized='table') }}" }} with source as (