-
Notifications
You must be signed in to change notification settings - Fork 60
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
[ADAP-504] [Regression] cannot run inside a transaction block #425
Comments
Thanks for reporting this @olivierdet. Can you share more about how you are calling your |
We're using |
Thanks again for reporting this @olivierdet. I was able to reproduce that this fails for dbt-redshift 1.5.0 but works for 1.4.x 👍 ReprexSee below for the macro and commands I used.
{% macro create_ci_database() %}
{% set database = "dbt_dbeatty" %}
{% set create_command %}
CREATE DATABASE {{ database }}
{% endset %}
{{ log(create_command, info=True) }}
{% do run_query(create_command) %}
{{ log("Created redshift database " ~ database, info=True) }}
{% endmacro %} Try to run the macro: dbt --debug run-operation create_ci_database |
Looks like the answer is to sneak a connection.autocommit=True into the right place. |
I have reported a related issue on the DBT forum - https://discourse.getdbt.com/t/cannot-drop-or-create-external-tables-since-upgrade-to-dbt-1-5-0/8265/2. |
The Redshift connector likely in its design philosophy does not allow CREATE DATABASE/VACUUM to be run without the autocommit feature true. But because how adapters are defined, we cannot preserve the original workflow without some extremely painful lift:
I'm going to merge #458 to give users a path forward. However, the hope of this issue cannot be attained without us going back to the drawing board. |
Is this a new bug in dbt-redshift?
Current Behavior
We have created a basic macro to create database.
This does not work anymore using the version 1.5
We have the following error message
Expected Behavior
The macro should work as worked in the version 1.4
Steps To Reproduce
Execute the following macro with dbt redshift v1.5
Relevant log output
No response
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: