This is such a weird bug, that I think it is best to just follow the reproduction steps. Note that I simplified the example as much as possible.
$ cat models/problematic_model.sql
{%- call statement('values_has_month', fetch_result=true) %}
select
'last month' as answer
{%- endcall -%}
{%- set value_list = load_result('values_has_month') -%}
select 1
$ dbt run
Running with dbt=0.15.0
Found 1 model, 0 tests, 0 snapshots, 0 analyses, 265 macros, 0 operations, 3 seed files, 0 sources
13:22:48 | Concurrency: 1 threads (target='dev_redshift')
13:22:48 |
13:22:48 | 1 of 1 START table model jaffle_shop_dev.problematic_model........... [RUN]
Unhandled error while executing model.jaffle_shop.problematic_model
year is out of range
13:22:53 | 1 of 1 ERROR creating table model jaffle_shop_dev.problematic_model.. [ERROR in 4.12s]
13:22:53 |
13:22:53 | Finished running 1 table model in 10.80s.
Completed with 1 error and 0 warnings:
year is out of range
Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1
No error
Can share logs if required, but I'm pretty confident you'll be able to reproduce it yourself.
Which database are you using dbt with?
have replicated on multiple databases:
The output of dbt debug:
dbt debug
Running with dbt=0.15.0
dbt version: 0.15.0
python version: 3.7.5
python path: /usr/local/Cellar/[email protected]/0.15.0_1/libexec/bin/python3.7
os info: Darwin-19.2.0-x86_64-i386-64bit
I don't think this is a bug in dbt (I suspect it's in Agate), but my debugging skillzzz are not good enough to figure out what's going on here.
BTW, this works:
{%- call statement('values_has_month', fetch_result=true) %}
select
'month' as answer
{%- endcall -%}
{%- set value_list = load_result('values_has_month') -%}
select 1
Also happy for you to close this with a #wontfix, but I'd love to know what's happening here!
Thanks for the report @clrcrl - I wonder if this is fixed by some of the agate work that we did for the Barbara Gittings release (eg. https://github.com/fishtown-analytics/dbt/pull/1920).
I'll try to repro
FYI: @emmacooperpeterson
This works fine on dev/barbara-gittings, and as @drewbanin noted this is exactly the kind of bug that #1920 fixed.
Most helpful comment
This works fine on
dev/barbara-gittings, and as @drewbanin noted this is exactly the kind of bug that #1920 fixed.