Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only raise error within union_relations for build/run sub-commands #607

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!--- Uncomment the following headers as-needed for unreleased features
<!--- Copy, paste, and uncomment the following headers as-needed for unreleased features
# Unreleased
## New features
## Fixes
Expand All @@ -7,6 +7,19 @@
## Contributors:
--->

# Unreleased

<!--- ## New features --->

## Fixes
- Only raise error within `union_relations` for `build`/`run` sub-commands ([#606](https://github.com/dbt-labs/dbt-utils/issues/606), [#607](https://github.com/dbt-labs/dbt-utils/pull/607))

<!--- ## Quality of life --->
<!--- ## Under the hood --->

## Contributors:
- [@jeremyyeo](https://github.com/jeremyyeo) (#606)

# dbt-utils v0.8.5
## 🚨 deduplicate ([#542](https://github.com/dbt-labs/dbt-utils/pull/542), [#548](https://github.com/dbt-labs/dbt-utils/pull/548))

Expand Down
4 changes: 4 additions & 0 deletions macros/sql/union.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
{%- endfor -%}

{%- set ordered_column_names = column_superset.keys() -%}
{%- set dbt_command = flags.WHICH -%}


{% if dbt_command in ['run', 'build'] %}
{% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}
{%- set relations_string -%}
{%- for relation in relations -%}
Expand All @@ -75,6 +78,7 @@

{{ exceptions.raise_compiler_error(error_message) }}
{%- endif -%}
{%- endif -%}

{%- for relation in relations %}

Expand Down