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

[Core] Explanation of the --empty flag to support unit tests #6051

Open
dbeatty10 opened this issue Sep 11, 2024 · 0 comments
Open

[Core] Explanation of the --empty flag to support unit tests #6051

dbeatty10 opened this issue Sep 11, 2024 · 0 comments
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core size: large This change will more than a week to address and might require more than one person

Comments

@dbeatty10
Copy link
Contributor

Link to the page(s) on docs.getdbt.com requiring updates

Tell us more about this update

This content feels like it could be combined, simplified, and unified (potentially into a shared snippet).

As-is the pages for run and build are missing the same level of detail that is contained in the unit tests page.

Simultaneously, the unit tests page feels like it might have too much detail.

Reviewers/Stakeholders/SMEs

.

Related GitHub issues

dbt-labs/dbt-core#10695

Additional information

💡 The key insight

When you run dbt tests in a stand-alone fashion (e.g., dbt test), it needs the database tables, views, etc. to exist in the database! Otherwise, it will give an error like "relation doesn't exist" 💥

👉 So doing a dbt run --empty creates all the database objects in the dbt project in the most minimal way possible -- just the column headers + data types, but no rows. Building these objects with zero rows is faster and incurs less warehouse spend than building the entire data set.

✅ Then after that, you're free to do dbt test --select some_specific_test as much as you want!

@dbeatty10 dbeatty10 added content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core labels Sep 11, 2024
@nataliefiann nataliefiann added the size: large This change will more than a week to address and might require more than one person label Sep 16, 2024
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 dbt Core The changes proposed in this issue relate to dbt Core size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

No branches or pull requests

2 participants