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

dbt compile tries to create a schema as of 0.17 #2525

Closed
2 of 5 tasks
seancron opened this issue Jun 9, 2020 · 2 comments · Fixed by #2528
Closed
2 of 5 tasks

dbt compile tries to create a schema as of 0.17 #2525

seancron opened this issue Jun 9, 2020 · 2 comments · Fixed by #2528
Labels
bug Something isn't working
Milestone

Comments

@seancron
Copy link

seancron commented Jun 9, 2020

Describe the bug

When running dbt compile on version 0.17, dbt executes a create schema if not exists statement if custom schemas are defined. This is a unexpected change as previous versions of dbt did not try to create a schema during dbt compile.

Steps To Reproduce

  1. Install dbt 0.17
  2. Setup a dbt project that defines custom schemas in dbt_project.yml using version 1 syntax (not sure if it makes a difference).
  3. Run dbt compile and check Snowflake query history or debug output to see that it tries to create a schema.

Expected behavior

dbt compile should not try to modify the database when running.

Screenshots and log output

Snippet from the dbt --debug output:

2020-06-09 22:27:41.474162 (MainThread): Acquiring new snowflake connection "master".
2020-06-09 22:27:41.474252 (MainThread): Opening a new connection, currently in state init
2020-06-09 22:27:41.482698 (ThreadPoolExecutor-0_0): Acquiring new snowflake connection "list_analytics".
2020-06-09 22:27:41.482933 (ThreadPoolExecutor-0_0): Opening a new connection, currently in state init
2020-06-09 22:27:41.492030 (ThreadPoolExecutor-0_0): Using snowflake connection "list_analytics".
2020-06-09 22:27:41.492177 (ThreadPoolExecutor-0_0): On list_analytics: /* {"app": "dbt", "dbt_version": "0.17.0", "profile_name": "jaffle_shop", "target_name": "dev", "connection_name": "list_analytics"} */

    show terse schemas in database analytics
    limit 10000
2020-06-09 22:27:43.145722 (ThreadPoolExecutor-0_0): SQL status: SUCCESS 171 in 1.65 seconds
2020-06-09 22:27:43.157762 (ThreadPoolExecutor-0_0): Acquiring new snowflake connection "create_analytics_dev_scronin_compile_test".
2020-06-09 22:27:43.157916 (ThreadPoolExecutor-0_0): Re-using an available connection from the pool (formerly list_analytics).
2020-06-09 22:27:43.158104 (ThreadPoolExecutor-0_0): Creating schema "analytics.dev_scronin_compile_test"
2020-06-09 22:27:43.163265 (ThreadPoolExecutor-0_0): Using snowflake connection "create_analytics_dev_scronin_compile_test".
2020-06-09 22:27:43.163414 (ThreadPoolExecutor-0_0): On create_analytics_dev_scronin_compile_test: BEGIN
2020-06-09 22:27:43.339854 (ThreadPoolExecutor-0_0): SQL status: SUCCESS 1 in 0.18 seconds
2020-06-09 22:27:43.340158 (ThreadPoolExecutor-0_0): Using snowflake connection "create_analytics_dev_scronin_compile_test".
2020-06-09 22:27:43.340351 (ThreadPoolExecutor-0_0): On create_analytics_dev_scronin_compile_test: /* {"app": "dbt", "dbt_version": "0.17.0", "profile_name": "jaffle_shop", "target_name": "dev", "connection_name": "create_analytics_dev_scronin_compile_test"} */
create schema if not exists analytics.dev_scronin_compile_test
2020-06-09 22:27:43.958637 (ThreadPoolExecutor-0_0): SQL status: SUCCESS 1 in 0.62 seconds
2020-06-09 22:27:43.960449 (ThreadPoolExecutor-0_0): On create_analytics_dev_scronin_compile_test: COMMIT
2020-06-09 22:27:43.960655 (ThreadPoolExecutor-0_0): Using snowflake connection "create_analytics_dev_scronin_compile_test".
2020-06-09 22:27:43.960765 (ThreadPoolExecutor-0_0): On create_analytics_dev_scronin_compile_test: COMMIT
2020-06-09 22:27:44.145170 (ThreadPoolExecutor-0_0): SQL status: SUCCESS 1 in 0.18 seconds

System information

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

installed version: 0.17.0
   latest version: 0.17.0

Up to date!

Plugins:
  - bigquery: 0.17.0
  - redshift: 0.17.0
  - postgres: 0.17.0
  - snowflake: 0.17.0

The operating system you're using:
Ubuntu 16.04

The output of python --version:
Python 3.8.2

Additional context

Original dbt Slack thread

@seancron seancron added bug Something isn't working triage labels Jun 9, 2020
@drewbanin drewbanin removed the triage label Jun 10, 2020
@drewbanin drewbanin added this to the 0.17.1 milestone Jun 10, 2020
@drewbanin
Copy link
Contributor

Thanks for the report @seancron! We're going to get this fixed in a near-term 0.17.1 patch release

@beckjake
Copy link
Contributor

Fixed in #2528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants