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

macro ref_cte_name(node) is not working properly #168

Closed
adrian-damaschin opened this issue Sep 4, 2023 · 3 comments
Closed

macro ref_cte_name(node) is not working properly #168

adrian-damaschin opened this issue Sep 4, 2023 · 3 comments

Comments

@adrian-damaschin
Copy link

This macro should return a CTE name for our source from concatenating package_name + node_name + node_version
https://github.com/EqualExperts/dbt-unit-testing/blob/master/macros/sql_builders.sql#L39

However this statement:
https://github.com/EqualExperts/dbt-unit-testing/blob/master/macros/sql_builders.sql#L45
returns True even if my node doesn't have a version key in the JSON. This way it means the final CTE name would be:

package_name__node_name__

which I am guessing is not the desired outcome

@lkell
Copy link

lkell commented Sep 15, 2023

I am having the same issue, specifically for a dbt seed. I haven't looked into the source code too much so I don't know if this is a good general fix, but I found that changing https://github.com/EqualExperts/dbt-unit-testing/blob/master/macros/sql_builders.sql#L45C32-L45C32 to

{% if node.version is not none and node.version is defined %}

resolved the issue for me.

@psousa50
Copy link
Collaborator

Hi all,

We've just released version v0.3.3, which should address this issue.

Please give it a try, and thank you very much for your feedback.

@adrian-damaschin
Copy link
Author

adrian-damaschin commented Sep 27, 2023

@psousa50
Yes, this solves the empty version issue. Thank you
However the framework is still not usable for us because of :
#169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants