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-2904] [Bug] Should clone with --full-refresh respect the model config? #8274

Open
2 tasks done
rudeb0y opened this issue Aug 1, 2023 · 2 comments
Open
2 tasks done
Labels
clone related to the dbt clone command enhancement New feature or request Refinement Maintainer input needed

Comments

@rudeb0y
Copy link

rudeb0y commented Aug 1, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

given the config:

  config(
    materialized = 'incremental',
    unique_key = 'event_key',
    on_schema_change = 'fail',
    incremental_strategy = 'delete+insert',
    transient=false,
    full_refresh=false,
    )
}}

when using the dbt clone -s <the_model> --full-refresh - the model is cloned.

Expected Behavior

Not sure what I'd want here. Personally I was pleased to see it not respected.. but it probably should be? Or it's a mix of concepts and it should be some --force flag or something with dbt clone to say "I don't care that it exists, clone it"

Steps To Reproduce

create an incremental model..

set full_refresh=false in it's config..

run dbt clone --full-refresh.

Which database adapter are you using with dbt?

dbt-snowflake==1.6.0

@rudeb0y rudeb0y added bug Something isn't working triage labels Aug 1, 2023
@github-actions github-actions bot changed the title [Bug] Should clone with --full-refresh respect the model config? [CT-2904] [Bug] Should clone with --full-refresh respect the model config? Aug 1, 2023
@jtcohen6
Copy link
Contributor

jtcohen6 commented Aug 2, 2023

@rudeb0y Thanks for trying out v1.6 & clone! :)

I don't think this was an intentional omission, but I'm with you that being able to pass --full-refresh and override the full_refresh: false config is actually quite nice. I think this speaks to a larger behavior change that we might want to make around the interop of the full refresh config & flag:

That aside: It's a little bit odd to think about setting full_refresh: true|false on a specific model for the purposes of configuring its clone behavior. I'm not sure what the use case would be for doing it. But for the sake of consistency, clone probably ought to respect that config.

@jtcohen6 jtcohen6 added Refinement Maintainer input needed and removed triage labels Aug 2, 2023
@jtcohen6 jtcohen6 added this to the v1.6.x milestone Aug 2, 2023
@rudeb0y
Copy link
Author

rudeb0y commented Aug 2, 2023

Ok cool - basically I have full_refresh: false to protect some models, in-case someone does a dbt run --full-refresh and broke an incremental model unintentionally. It has a rollup element so the full_refresh output is not the same as the incremental and hence want that preserved (It's not great, should get same output regardless but we cannot at this time).

That said once build is done I still want to clone that incremental model into a new env hence why it was in this case.. fine!👍

@graciegoheen graciegoheen added enhancement New feature or request and removed bug Something isn't working labels Nov 16, 2023
@graciegoheen graciegoheen removed this from the v1.6.x milestone Nov 16, 2023
@dbeatty10 dbeatty10 added the clone related to the dbt clone command label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clone related to the dbt clone command enhancement New feature or request Refinement Maintainer input needed
Projects
None yet
Development

No branches or pull requests

4 participants