We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The log macro cause the model evaluation to fail when executed in a model level pre/post-hook unless the select 1 hack is applied.
log
pre/post-hook
select 1
Here is the relevant snippet from the dbt_project.yml
dbt_project.yml
# no problem here on-run-start: "{{ log('project level: pre-hook', True) }}" on-run-end: "{{ log('project level: post-hook', True) }}" models: # fails # pre-hook: "{{ log('models level: pre-hook', True) }}" # post-hook: "{{ log('models level: post-hook', True) }}" # works pre-hook: "{{ log('models level: pre-hook', True) }} select 1" post-hook: "{{ log('models level: post-hook', True) }} select 1"
What happened?
Without the select 1 workaround I get the following ...
Found 3 operations, 91 macros, 0 analyses, 0 seed files, 0 tests, 1 models, 0 archives project level: pre-hook 16:23:32 | Concurrency: 1 threads (target='prod') 16:23:32 | 16:23:32 | 1 of 1 START view model experimental.my_first_dbt_model.............. [RUN] models level: pre-hook 16:23:33 | 1 of 1 ERROR creating view model experimental.my_first_dbt_model..... [ERROR in 0.86s] project level: post-hook 16:23:33 | 16:23:33 | Finished running 1 view models in 1.17s. Completed with 1 errors: Database Error in model my_first_dbt_model (models/example/my_first_dbt_model.sql) can't execute an empty query compiled SQL at target/compiled/my_new_package/example/my_first_dbt_model.sql Done. PASS=0 ERROR=1 SKIP=0 TOTAL=1
What did you expect to happen?
Expected the view to be successfully created with models level: pre-hook to be printed before the view creation and models level: post-hook after.
models level: pre-hook
models level: post-hook
The output of dbt --version:
dbt --version
installed version: 0.11.1 latest version: 0.11.1 Up to date!
The operating system you're running on: mac sierra
The python version you're using (probably the output of python --version) 2.7
python --version
2.7
Add the above dbt_project.yml snippet to the sample project autogenerated by db init and connect to redshift.
db init
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issue
Issue description
The
log
macro cause the model evaluation to fail when executed in a model levelpre/post-hook
unless theselect 1
hack is applied.Here is the relevant snippet from the
dbt_project.yml
Results
What happened?
Without the
select 1
workaround I get the following ...What did you expect to happen?
Expected the view to be successfully created with
models level: pre-hook
to be printed before the view creation andmodels level: post-hook
after.System information
The output of
dbt --version
:The operating system you're running on: mac sierra
The python version you're using (probably the output of
python --version
)2.7
Steps to reproduce
Add the above
dbt_project.yml
snippet to the sample project autogenerated bydb init
and connect to redshift.The text was updated successfully, but these errors were encountered: