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

[CT-3310] Support --empty flag for dbt seed #8981

Open
1 task done
Tracked by #8283
graciegoheen opened this issue Nov 1, 2023 · 4 comments
Open
1 task done
Tracked by #8283

[CT-3310] Support --empty flag for dbt seed #8981

graciegoheen opened this issue Nov 1, 2023 · 4 comments
Labels
empty Issues related to the --empty CLI flag Impact: Adapters unit tests Issues related to built-in dbt unit testing functionality user docs [docs.getdbt.com] Needs better documentation

Comments

@graciegoheen
Copy link
Contributor

graciegoheen commented Nov 1, 2023

Housekeeping

  • I am a maintainer of dbt-core

Short description

dbt seed --empty produces empty (0 row) seeds in the warehouse:

  • on most DWHs this would be quite simple, since we already create empty table + then insert
  • BQ implementation is quite different though

Acceptance criteria

dbt seed --empty produces empty (0 row) seeds in the warehouse

Impact to Other Teams

impact adapters

Will backports be required?

no

Context

blocked by #8980

@graciegoheen graciegoheen added user docs [docs.getdbt.com] Needs better documentation Impact: Adapters labels Nov 1, 2023
@github-actions github-actions bot changed the title --empty flag for dbt seed [CT-3310] --empty flag for dbt seed Nov 1, 2023
@jtcohen6
Copy link
Contributor

I'm moving issues from dbt-core to dbt-adapters that relate to implementation logic which now lives in the latter, but I'm leaving this one here because it's possible we could implement this within dbt-core

@dbeatty10 dbeatty10 added unit tests Issues related to built-in dbt unit testing functionality empty Issues related to the --empty CLI flag labels Sep 20, 2024
@dbeatty10 dbeatty10 changed the title [CT-3310] --empty flag for dbt seed [CT-3310] Support --empty flag for dbt seed Sep 24, 2024
@dbeatty10
Copy link
Contributor

Implementation hint

See #10962 for how this was implemented for snapshots.

@ChenyuLInx
Copy link
Contributor

Potentially, put a limit here

@dbeatty10
Copy link
Contributor

Potentially, put a limit here

Good idea! 💡

When empty is True for a seed, then we could try something like this:

        result.agate_table = agate_result.table.limit(0)

And otherwise leave it as-is:

        result.agate_table = agate_result.table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
empty Issues related to the --empty CLI flag Impact: Adapters unit tests Issues related to built-in dbt unit testing functionality user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

No branches or pull requests

4 participants