From 9d5cbf7e51f61e73c2e1faa0fa03f4e74f85ecf4 Mon Sep 17 00:00:00 2001 From: Jacob Beck Date: Mon, 3 Dec 2018 14:32:47 -0700 Subject: [PATCH] strip the schema when there is extra whitespace --- dbt/parser/base.py | 2 +- test/integration/024_custom_schema_test/macros/schema.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt/parser/base.py b/dbt/parser/base.py index f4f169bfa96..f884335c965 100644 --- a/dbt/parser/base.py +++ b/dbt/parser/base.py @@ -121,7 +121,7 @@ def parse_node(cls, node, node_path, root_project_config, schema_override = config.config.get('schema') get_schema = context.get('generate_schema_name', lambda x: default_schema) - parsed_node.schema = get_schema(schema_override) + parsed_node.schema = get_schema(schema_override).strip() parsed_node.alias = config.config.get('alias', default_alias) # Set tags on node provided in config blocks diff --git a/test/integration/024_custom_schema_test/macros/schema.sql b/test/integration/024_custom_schema_test/macros/schema.sql index b2456437d31..327da5585d3 100644 --- a/test/integration/024_custom_schema_test/macros/schema.sql +++ b/test/integration/024_custom_schema_test/macros/schema.sql @@ -1,6 +1,6 @@ -{% macro generate_schema_name(schema_name) -%} +{% macro generate_schema_name(schema_name) %} {{ schema_name }}_{{ target.schema }}_macro -{%- endmacro %} +{% endmacro %}