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

Support --empty flag for schema-only dry runs from dbt-core PR #8971 #4572

Closed
FishtownBuildBot opened this issue Dec 3, 2023 · 2 comments · Fixed by #4966
Closed

Support --empty flag for schema-only dry runs from dbt-core PR #8971 #4572

FishtownBuildBot opened this issue Dec 3, 2023 · 2 comments · Fixed by #4966
Assignees
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

Comments

@FishtownBuildBot
Copy link

FishtownBuildBot commented Dec 3, 2023

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 optional limit parameter to the create_ephemeral_from_node method and the BaseRelation class, and adding a new command line option --empty to limit the input refs and sources to zero rows.

Solution

  • BaseRelation changes
    • Adds an optional limit to BaseRelation
    • Implements BaseRelation.render_limited: depending on the value of self.limit, this method templates sql to wrap a rendered relation in an 'empty' select statement. Further reasoning in the spike report
    • Updates BaseRelation.__str__ to use self.render_limited if self.limit is set
  • Adds --empty flag to run and build commands.
    • This flag configuration is used to determine the value for resolve_limit on the BaseResolver
    • BaseResolver plumbs its resolve_limit to the Relation instance it is creating, which is responsible for rendering itself given an optional limit parameter.
@runleonarun runleonarun added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear dbt Core The changes proposed in this issue relate to dbt Core labels Dec 3, 2023
@runleonarun runleonarun changed the title Docs Changes Needed from dbt-core PR #8971 Support --empty flag for schema-only dry runs from dbt-core PR #8971 Jan 18, 2024
@MichelleArk
Copy link
Contributor

Originating issue: dbt-labs/dbt-core#8980

@runleonarun
Copy link
Collaborator

@matthewshaver I think we should aim to have all issues addressed by Friday 2/23 to give reviewers and authors enough time. Let me know if you need support!

@matthewshaver matthewshaver linked a pull request Feb 21, 2024 that will close this issue
4 tasks
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 dbt-core v1.8 improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants