Skip to content

Commit acc88e4

Browse files
committed
Get tests to pass
1 parent f2ac06a commit acc88e4

File tree

4 files changed

+16
-36
lines changed

4 files changed

+16
-36
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
. venv/bin/activate
2626
2727
pip install --upgrade pip setuptools
28-
pip install dbt
28+
pip install dbt --pre
2929
3030
mkdir -p ~/.dbt
3131
cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
col_1,col_2,col_3
2-
1,a,4.0
3-
2,b,5.0
4-
3,c,
2+
1,a,4.1
3+
2,b,5.2
4+
3,c,

integration_tests/dbt_project.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ version: '1.0'
44

55
profile: 'integration_tests'
66

7+
require-dbt-version: ">=0.15.0"
8+
79
source-paths: ["models"]
8-
analysis-paths: ["analysis"]
10+
analysis-paths: ["analysis"]
911
test-paths: ["tests"]
1012
data-paths: ["data"]
1113
macro-paths: ["macros"]
@@ -14,23 +16,23 @@ target-path: "target" # directory which will store compiled SQL files
1416
clean-targets: # directories to be removed by `dbt clean`
1517
- "target"
1618
- "dbt_modules"
17-
19+
1820
seeds:
1921
dbt_utils_integration_tests:
2022
enabled: true
21-
23+
2224
cross_db:
2325
data_date_trunc:
2426
column_types:
2527
updated_at: timestamp
2628
day: date
2729
month: date
28-
30+
2931
data_dateadd:
3032
column_types:
3133
from_time: timestamp
3234
result: timestamp
33-
35+
3436
data_datediff:
3537
column_types:
3638
first_date: timestamp

integration_tests/tests/assert_fetch_objects_equal.sql

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,29 @@
33
{% set expected_dictionary={
44
'col_1': [1, 2, 3],
55
'col_2': ['a', 'b', 'c'],
6-
'col_3': [4.0, 5.0, none]
6+
'col_3': [4.1, 5.2, none]
77
} %}
88

99
{% set actual_dictionary=dbt_utils.fetch(
1010
"select * from " ~ ref('data_fetch')
1111
) %}
1212

13-
{% if target.type == 'snowflake' %}
14-
15-
{% if actual_dictionary['COL_1'] | map('int',default=none) | list != expected_dictionary['col_1'] %}
16-
{# select > 0 rows for test to fail #}
17-
select 1
18-
19-
{% elif actual_dictionary['COL_2'] | list != expected_dictionary['col_2']%}
20-
{# select > 0 rows for test to fail #}
21-
select 1
22-
23-
{% elif actual_dictionary['COL_3'] | map('float',default=none) | list != expected_dictionary['col_3'] %}
24-
{# select > 0 rows for test to fail #}
25-
select 1
26-
27-
{% else %}
28-
{# select 0 rows for test to pass #}
29-
select 1 limit 0
30-
31-
{% endif %}
32-
33-
{% else %}
34-
35-
{% if actual_dictionary['col_1'] | map('int',default=none) | list != expected_dictionary['col_1'] %}
13+
{% if actual_dictionary['col_1'] | map('int', default=none) | list != expected_dictionary['col_1'] %}
3614
{# select > 0 rows for test to fail #}
3715
select 1
3816

3917
{% elif actual_dictionary['col_2'] | list != expected_dictionary['col_2']%}
4018
{# select > 0 rows for test to fail #}
4119
select 1
4220

43-
{% elif actual_dictionary['col_3'] | list != expected_dictionary['col_3'] %}
21+
{% elif actual_dictionary['col_3'] | map('float', default=none) | list != expected_dictionary['col_3'] %}
4422
{# select > 0 rows for test to fail #}
4523
select 1
24+
{{ log(actual_dictionary['col_3'] | map('float', default=none) | list, info=True) }}
25+
{{ log(expected_dictionary['col_3'], info=True) }}
4626

4727
{% else %}
4828
{# select 0 rows for test to pass #}
4929
select 1 limit 0
5030

5131
{% endif %}
52-
53-
{% endif %}

0 commit comments

Comments
 (0)