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

Do you plan to enhance it for incremental models? #83

Closed
ghost opened this issue Aug 8, 2022 · 9 comments
Closed

Do you plan to enhance it for incremental models? #83

ghost opened this issue Aug 8, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Aug 8, 2022

we could not be sure incremental materialization strategies is working well or missing sth so thats why I am asking.

@LiliaBh
Copy link

LiliaBh commented Aug 25, 2022

Hi,
same question. Incremental models could not be tested, is there a workaround?

@jkaczanowski-rest
Copy link

+1
an dbt_unit_testing.mock_initial() section? and/or some way to mock {{ 'this' }}?

@kborn
Copy link

kborn commented Jan 11, 2023

+1 on this as well

@mjharper
Copy link

+1 being able to mock {{ this }}

@cdiniz cdiniz added the enhancement New feature or request label Mar 18, 2023
@hugohjerten
Copy link

+1! I love this package! But without support for incremental models, we will not be able to test our most important models 😢

@psousa50
Copy link
Collaborator

Hello everyone,

We have created a new branch proposing an implementation of "dbt-unit-testing" that supports "incremental-models".

As you will see, our solution is a bit 'intrusive', at least for those we prefer to redefine the "ref" macro instead of using "dbt_init_testing.ref" on your models. Here you'll have to use some "dbt_init_testing.xxx", as explained in the README.

We did try to find a less intrusive solution, but our attempts seemed hacky, so we decided to keep it like this.

We are eager to hear your feedback and suggestions, so please give it a try and let us know your thoughts. We hope it will save you time and prove useful.

To access this branch, you will need to change the revision of the package as follows:

packages:
  - git: "https://github.com/EqualExperts/dbt-unit-testing"
    revision: e4a93ebd08ccd388d212b1ec636da2e467db12b9

Please do not hesitate to share your feedback with us. Thank you!

@clennox-optimizely
Copy link

I've implemented a "hacky" version of this feature (seriously, it was a mess), and this slightly intrusive macro method seems to be the best case scenario. Given that the is_incremental() macro isn't exposed in the dbt builtins you don't have much option other than a custom macro.

Regarding the custom this macro - is there any better way to do that by defining a mock on the fully qualified name of the model itself? I suspect not since dbt doesn't quote the model name when using {{ this }}, but you might have more insight than I do.

@p0tr3c
Copy link

p0tr3c commented Jun 9, 2023

Hey, the implemented PR works great. Is there anything I could help with trying to get this released?

@psousa50
Copy link
Collaborator

Hey folks, we've just published a new release (RC) with support for incremental models. It's a slightly improved version of the one above, so there's no need to change the project code now. Please try it out; we would love to hear your feedback on this 🙂

Thank you!

@cdiniz cdiniz closed this as completed Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants