dbt-labs / dbt-snowflake

dbt-snowflake contains all of the code enabling dbt to work with Snowflake
https://getdbt.com
Apache License 2.0
297 stars 177 forks source link

[Bug] Fix scenarios where `--empty` flag pushes `limit 0` into metadata queries #1100

Closed mikealfare closed 4 months ago

mikealfare commented 5 months ago

resolves #1033

Problem

We use {{ relation }} to render the relation name in metadata queries. However, we implemented the --empty flag to add limit 0 when {{ relation }} is used. We wind up with queries like:

describe table (select * from my_relation limit 0)

which is not valid sql.

Solution

Implementation

  1. Merge this PR demonstrating that these tests work (we`re here)
  2. Move the bulk of this PR into dbt-tests-adapter
  3. Create a final PR that removes most of this and uses the dbt-tests-adapter tests

Checklist

github-actions[bot] commented 5 months ago

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide.

pempey commented 3 months ago

@mikealfare When might one expect these change in a release? Or is there a way to test these changes on our system before a release?

pempey commented 2 months ago

I will ask my question to a larger audience: @colin-rogers-dbt @McKnight-42 @jtcohen6 When might one expect these change in a release? Or is there a way to test these changes on our system before a release?