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

actual test case for #257 #290

Merged
merged 1 commit into from
Apr 12, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
export DBT_PROFILES_DIR=.
dbt deps --target ${{ matrix.data-platform }}
dbt seed --full-refresh --target ${{ matrix.data-platform }}
dbt run --target ${{ matrix.data-platform }}
dbt run-operation prep_external --target ${{ matrix.data-platform }}
dbt run-operation dbt_external_tables.stage_external_sources --vars 'ext_full_refresh: true' --target ${{ matrix.data-platform }}
dbt run-operation dbt_external_tables.stage_external_sources --target ${{ matrix.data-platform }}
Expand Down
6 changes: 6 additions & 0 deletions integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ dispatch:
seeds:
+quote_columns: false

models:
dbt_external_tables_integration_tests:
plugins:
snowflake:
+enabled: "{{ target.type == 'snowflake' }}"

sources:
dbt_external_tables_integration_tests:
plugins:
Expand Down
4 changes: 4 additions & 0 deletions integration_tests/models/plugins/snowflake/people_alias.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT
{{ dbt_utils.star(from=ref('people'), except=['email']) }},
email as email_alias
FROM {{ ref('people') }}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ sources:
data_type: varchar(64)
- name: email
data_type: varchar(64)
- name: email
alias: email_alias
data_type: varchar(64)
tests: &equal-to-the-people
- dbt_utils.equality:
compare_model: ref('people')
Expand All @@ -31,7 +28,6 @@ sources:
- first_name
- last_name
- email
- email_alias

- name: people_csv_partitioned
external:
Expand Down Expand Up @@ -155,4 +151,26 @@ sources:
tests: *equal-to-the-people
columns:
- name: id
description: "the unique ID for people"
description: "the unique ID for people"

# test for column aliasing
- name: people_csv_aliased
external: *csv-people
columns:
- name: id
data_type: int
- name: first_name
data_type: varchar(64)
- name: last_name
data_type: varchar(64)
- name: email
alias: email_alias
data_type: varchar(64)
tests:
- dbt_utils.equality:
compare_model: ref('people_alias')
compare_columns:
- id
- first_name
- last_name
- email_alias
Loading