Support --empty flag for schema-only dry runs from dbt-core PR #8971 #4572
Labels
content
Improvements or additions to content
dbt Core
The changes proposed in this issue relate to dbt Core
dbt-core v1.8
improvement
Use this when an area of the docs needs improvement as it's currently unclear
Milestone
This change includes a variety of changes to improve the functionality and usability of the codebase. The most important changes include adding new test cases for running
dbt run
with and without the--empty
flag, adding a new optionallimit
parameter to thecreate_ephemeral_from_node
method and theBaseRelation
class, and adding a new command line option--empty
to limit the input refs and sources to zero rows.Solution
BaseRelation
changeslimit
toBaseRelation
BaseRelation.render_limited
: depending on the value ofself.limit
, this method templates sql to wrap a rendered relation in an 'empty' select statement. Further reasoning in the spike reportBaseRelation.__str__
to useself.render_limited
ifself.limit
is set--empty
flag torun
andbuild
commands.resolve_limit
on theBaseResolver
BaseResolver
plumbs itsresolve_limit
to theRelation
instance it is creating, which is responsible for rendering itself given an optionallimit
parameter.The text was updated successfully, but these errors were encountered: