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

update check cols all syntax to be correct #6731

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

trouze
Copy link
Contributor

@trouze trouze commented Jan 7, 2025

What are you changing in this pull request and why?

This is a really small change to setting your check_cols config in the new yaml snapshot definitions correctly. The old version was syntactically incorrect as putting all in an iterable like

check_cols:
  - all

caused dbt to end up executing the elif block when trying to ascertain the schema shape.

The correct syntax introduced here has dbt execute the correct line instead.

The current syntax leads a user to get the following error as dbt tries to execute this introspective query as it treats all like it's a column name:

select * from (
        select all from (
                select * from database.schema.snapshot
            ) subq
    ) as __dbt_sbq
    where false
    limit 0
20:13:50 Snowflake adapter: Snowflake query id: xxx
20:13:50 Snowflake adapter: Snowflake error: xxx (xxx): xxx: SQL compilation error:
syntax error line 2 at position 19 unexpected 'from'.
20:13:50 Database Error in snapshot snapshot_name (snapshots/snapshot.yml)
  xxx (xxx): xxx: SQL compilation error:
  syntax error line 2 at position 19 unexpected 'from'.

Checklist

  • I have reviewed the Content style guide so my content adheres to these guidelines.
  • The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the version a whole page and/or version a block of content guidelines.
  • I have added checklist item(s) to this list for anything anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch."
  • The content in this PR requires a dbt release note, so I added one to the release notes page.

🚀 Deployment available! Here are the direct links to the updated files:

@trouze trouze requested a review from a team as a code owner January 7, 2025 20:49
Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview Jan 7, 2025 8:49pm

@github-actions github-actions bot added content Improvements or additions to content size: x-small This change will take under 3 hours to fix. labels Jan 7, 2025
@matthewshaver matthewshaver merged commit 1b43994 into current Jan 7, 2025
12 checks passed
@matthewshaver matthewshaver deleted the trouze/check-cols-all branch January 7, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content size: x-small This change will take under 3 hours to fix.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants